What is per-pixel mean?

J
jay_singh · Jul 27, 2021 · 2K views
Question
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?
Expert Answer
Profile picture of Kshitij Singh
Kshitij Singh PhD Expert
Answered Nov 20, 2025
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.

Have a different question? Ask here

Get a Free Consultation or a Sample Assignment Review!