MATLAB: How to get value of all pixel in grayscale image

grayscaleImage Processing Toolboxpixel

i have a grayscale image 80×80, how to get the value of pixel from that image?

Best Answer

You specify the row and column:
grayImage = imread(filename);
% Find intensity at row 5, column 39:
thisIntensity = grayImage(5, 39);
% or
thisIntensity = impixel(grayImage, 5, 39);
You might also like to mouse around over the image and see a "live" interactive readout of the x, y, and intensity. If so, do this:
hp = impixelinfo();
You can then place it where like by doing
hp.Position = [x, y, width, height];