pixels value in grayscale image
2 views (last 30 days)
Show older comments
I'm new beginner in imaging matlab, I have a easy project but I just know how to insert an image in matlab. the problems is 1)I have a grayimage, how to obtain the total pixels number. 2)if I want to get many scale pixels number, eg: the color range is 0-255, if I want to know 0-10 how many pixels I have in this image, 11-20 how many pixels I have in this image,ect. how to extract it?? thank you very much, if you program it I will appreciate it.

0 Comments
Answers (1)
Image Analyst
on 10 Jan 2017
Take the histogram
totalNumberOfPixelsInIMage = numel(grayImage)
[pixelCounts, grayLevels] = imhist(grayImage);
If you're a beginner, you must see my Image Segmentation Tutorial in my File Exchange: http://www.mathworks.com/matlabcentral/fileexchange/?term=authorid%3A31862 because it goes over all the basic steps you'll need for a typical thresholding-based image segmentation, analysis, and classification.
0 Comments
See Also
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!