MATLAB Answers


to calculate histogram features

Asked by Elysi Cochin on 6 Feb 2013

to calculate histogram features using the equation in the following link,.....

will it work if i use imhist function..... but how to implement the summation with the values i....... please do reply....




No products are associated with this question.

1 Answer

Answer by Walter Roberson
on 6 Feb 2013
 Accepted answer

Yes, you could use imhist(), but remember you need to break the image up into MxM blocks, and imhist() is a more expensive calculation than hist() or histc() is.


sir if i use this line of code..... which parameters maximum i need to obtain for the reault in the equation.... please do reply...

 [pixelCount grayLevels] = imhist(grayImage)

is it

 max(pixel count)



"where histo(i) is the value of the histogram with the intensity i"

so you need to be concerned with the output that reflects histogram values, not histogram intensities.

I think that "H = arg i max(histo(i))" is intended to mean that H is the "i" such that histo(i) is the maximum -- that is, the index of the maximum intensity.

And you still need to think more about what bin centers or edges you are going to pass in to the histogram routine you choose.

sir please could you show me how to write the code for what u explained above for a image as a whole..... please reply sir....

Join the 15-year community celebration.

Play games and win prizes!

Learn more
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!