필터 지우기
필터 지우기

PDF from a histogram ?

조회 수: 5 (최근 30일)
MIRK
MIRK 2015년 3월 20일
편집: MIRK 2015년 3월 20일
Why the plot of PDF of second plot is not the same of the first one what correction should I make on second to make it right PDF

답변 (1개)

Image Analyst
Image Analyst 2015년 3월 20일
What's wrong with
pdf = f / numel(f);
??
  댓글 수: 3
Image Analyst
Image Analyst 2015년 3월 20일
The histogram is the frequency of occurrence of values - in other words, the likelihood that that value will occur. Well, isn't that also the definition of probability density function, except that the pdf has the integral of the function (sum, area under the curve) of 1. So I divided the histogram counts by the number of elements so that when it's integrated (summed), the sum will equal 1, just like the pdf.
Anyway, assuming you get the pdf or histogram, then what? What do you want to do once you have that? We may not need to quibble over histogram details or plots to do whatever it is that you need to really do. So please explain what you plan on doing with the histogram or pdf.
Image Analyst
Image Analyst 2015년 3월 20일
When you plot d, d is
d= f/c/diff(x(1:2))
Well diff(x(1:2)) is just 1 since imhist will default to taking a bin width of 1 gray level. So d is just the counts divided by the number of columns. It should be divided by the number of pixels, which is c*r.

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

카테고리

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