pixels value in grayscale image

2 ビュー (過去 30 日間)
mengqi zhang
mengqi zhang 2017 年 1 月 10 日
回答済み: Image Analyst 2017 年 1 月 10 日
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.

回答 (1 件)

Image Analyst
Image Analyst 2017 年 1 月 10 日
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.

カテゴリ

Help Center および File ExchangeGet Started with Image Processing Toolbox についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by