pixels value in grayscale image

2 vues (au cours des 30 derniers jours)
mengqi zhang
mengqi zhang le 10 Jan 2017
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.

Réponses (1)

Image Analyst
Image Analyst le 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.

Catégories

En savoir plus sur Get Started with Image Processing Toolbox dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by