What is per-pixel mean?
11 ビュー (過去 30 日間)
古いコメントを表示
To train the CNN, RGB images(in some cases color-ROI) are preprocessed by resizing it to the smallest dimension to 256, and then we crop center 256*256 region. After this per-pixel mean(across all the image) is subtracted.
I don't get a proper sense of this concept. Is there anyone can explain?
0 件のコメント
採用された回答
Walter Roberson
2016 年 6 月 27 日
You have a whole series of extracted images that are the same size. The per-pixel mean over the images is the mean across all the pixels for any one fixed location. So for example if the extract images are stored in AllImages,
mean(AllImages(17, 38, :))
would be the per-pixel mean for location (17, 38)
You can do this all at one time for the pixels by using
mean(AllImages, 3)
where the 3 indicates the third dimension, provided that the different images are stored as having a different third-dimensional coordinate in the array.
0 件のコメント
その他の回答 (1 件)
Image Analyst
2016 年 6 月 26 日
The image is resized to 256 rows or columns, along whichever dimension is smallest. The size of the other dimension is not given by you - it may also be 256, or it may be something such that the aspect ratio of the image stays the same, or it maybe something else. Regardless, you have a square or rectangular image that's 256 wide along some dimension and then it extracts the middle 256-by-256 square from that rectangular image. For example, the image is originally 480-by-640. Then it's resized to 256 by 640 (or whatever). Then the middle 256-by-256 image is extracted, essentially from row 128 to 384. Now you have a 256-by-256 square image. Then subtract the mean.
% Resize image
[rows, columns, numberOfColorChannels) = size(originalImage); % Get starting dimensions.
resizedImage = imresize(originalImage, [256, columns]);
% Extract middle 256 chunk.
col1 = columns - 128
col2 = col1 + 127
croppedImage = resizedImage(:, col1:col2);
% Compute mean of extracted chunk.
theMean = mean2(croppedImage)
% Subtract mean from the cropped image.
finalImage = croppedImage - theMean; % For grayscale only.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Image Processing and Computer Vision についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!