how to get value of all pixel in grayscale image?

7 views (last 30 days)
i have a grayscale image 80x80, how to get the value of pixel from that image?

Accepted Answer

Image Analyst
Image Analyst on 24 Nov 2017
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];
  8 Comments
Ankita Mukund Mandale
Ankita Mukund Mandale on 7 Jul 2021
Thanks its working. But I want to plot grayvalues and pixel. From that graph I want to get gaussian curve. Could you help me with it ?
Image Analyst
Image Analyst on 8 Jul 2021
Sure. Did you use the plot() function? And what do you think the difference is between "grayvalues" and "pixel"??? The value of a pixel is its gray level. And the gray levels are what they are, and they may not be the Gaussian curve you're expecting.

Sign in to comment.

More Answers (0)

Categories

Find more on Image Processing Toolbox in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!