MATLAB: Matlab image, get mean values of selected coordinates

image analysisimage processing

Hello,
I would like to analyse mean values of an image. However, I do not want to see mean values of whole image but just the selected parts.
My images are like the ones below, they are saliency maps. So, ca you please help me to find a code to analyse the mean values of for instance, y= 177:400 x= 37:393?
I am quite new at Matlab, so I would really appreciate if you can let me know all the steps that I should follow.
Thanks
31-2.jpg

Best Answer

  • Let Z be your data. You caextract the required chunk/ part dep[ending on the indices and get mean.
    y= 177:400;
    x= 37:393 ;
    T = Z(x,y) ; % this gives you required chunk
    iwant = mean(T(:))