How can I calculate normalized histogram from some squared regions of an image?

조회 수: 2 (최근 30일)
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.....

채택된 답변

Image Analyst
Image Analyst 2016년 7월 21일
Can't you just use histogram with the 'pdf' or 'probability' option?
  댓글 수: 3
Image Analyst
Image Analyst 2016년 7월 22일
From the help:
Description
histogram(X) creates a histogram plot of X. The histogram function uses an automatic binning algorithm that returns bins with a uniform width, chosen to cover the range of elements in X and reveal the underlying shape of the distribution. histogram displays the bins as rectangles such that the height of each rectangle indicates the number of elements in the bin.
'probability': The height of each bar is the relative number of observations, (number of observations in bin / total number of observations). The sum of the bar heights is 1. For categorical histograms, the height of each bar is, (number of elements in category / total number of elements in all categories). The sum of the bar heights is 1.
'pdf': Probability density function estimate. The height of each bar is, (number of observations in the bin) / (total number of observations * width of bin). The area of each bar is the relative number of observations. The sum of the bar areas is 1. For categorical histograms, this is the same as 'probability'.
K M Ibrahim Khalilullah
K M Ibrahim Khalilullah 2016년 7월 22일
Thank you very much. I understand. would you explain please how can I combine three different squared regions to make X?

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Histograms에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by