Borrar filtros
Borrar filtros

PDF from a histogram ?

5 visualizaciones (últimos 30 días)
MIRK
MIRK el 20 de Mzo. de 2015
Editada: MIRK el 20 de Mzo. de 2015
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

Respuestas (1)

Image Analyst
Image Analyst el 20 de Mzo. de 2015
What's wrong with
pdf = f / numel(f);
??
  3 comentarios
Image Analyst
Image Analyst el 20 de Mzo. de 2015
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 el 20 de Mzo. de 2015
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.

Iniciar sesión para comentar.

Categorías

Más información sobre Histograms en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by