MATLAB: What is per-pixel mean

Computer Vision ToolboxDeep Learning Toolboxdigital image processingImage Processing Toolboxneural networksStatistics and Machine Learning Toolbox

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?

Best Answer

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.
Related Question