MATLAB: How to calculate normalized histogram from some squared regions of an image

histogramimage processing

I have three squared sized regions, which are cropped from a gray scale image. The size of each region is K by K. How can I calculate normalized histogram from the cropped regions and display the histogram like the following figure, which I have shown below…..

Best Answer

Can't you just use histogram with the 'pdf' or 'probability' option?