image processing

조회 수: 1 (최근 30일)
harjan
harjan 2011년 10월 28일
What is the relationship between gray level of an image to histogram. I know about histogram that implies the number of pixels in particular gray level.But is it possible to calculate gray percentage using histogram value?.....

채택된 답변

Amith Kamath
Amith Kamath 2011년 10월 29일
Histogram is a statistic of the image that gives information about the number of pixels of a particular intensity. It is irreversible, in the sense that with a histogram, you cannot recreate the image, and hence cannot predict the pixel value at a particular point. Having said this, it is possible to calculate the percentage of a particular gray level. This is equivalent to just normalizing the histogram on a unit scale. For example,
I = imread('rice.png');
hist = imhist(I);
%percentage of pixels that have the value 105, is
hist(105)/sum(hist) %This is the fraction.
and as a check, sum(hist) should always be equal to the number of pixels in the image.
Hope this helps!

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Get 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