フィルターのクリア

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 Center および File ExchangeHistograms についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by