Borrar filtros
Borrar filtros

Image processing: finding transfer function of histogram equalization

5 visualizaciones (últimos 30 días)
Hello, lets say I have an image then I adjusted the contrast by using histogram equalization (histeq) Is there a way to plot or get an image of the transfer function that this command uses ?

Respuesta aceptada

Image Analyst
Image Analyst el 18 de Nov. de 2013
Just take the histogram of the original image, then call cumsum on the pixel counts and plot it.
[pixelCounts, grayLevels] = imhist(grayImage);
cdf = cumsum(pixelCounts); % Make transfer function (look up table).
cdf = cdf / sum(cdf); % Normalize
plot(grayLevels, cdf, 'b-');
  3 comentarios
Royi Avital
Royi Avital el 3 de Mayo de 2015
This will work for Equalization. What if I want any other CDF function?
Image Analyst
Image Analyst el 3 de Mayo de 2015
Huh? That has nothing to do with equalization, though equalization can use the cdf just like a lot of other functions do. This is just general purpose code that will compute the cdf regardless of your histogram. What do you mean by "other CDF"? What other CDF functions might there be?

Iniciar sesión para comentar.

Más respuestas (1)

Anand
Anand el 18 de Nov. de 2013
Or use the two argument syntax for histeq.
[histIm,T] = histeq(grayImage);
plot(T,'b-')
  2 comentarios
Image Analyst
Image Analyst el 18 de Nov. de 2013
I didn't know it had that output - I guess I should have looked. Of course like I warn people histogram equalization gives a nonlinear stretch which usually looks pretty crummy and unnatural. imadjust() almost always gives a better looking image.
John Snow
John Snow el 18 de Nov. de 2013
The result isnt "smooth" so I will take the first answer but thanks anyway

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