필터 지우기
필터 지우기

Image processing: finding transfer function of histogram equalization

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

채택된 답변

Image Analyst
Image Analyst 2013년 11월 18일
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
Royi Avital
Royi Avital 2015년 5월 3일
This will work for Equalization. What if I want any other CDF function?
Image Analyst
Image Analyst 2015년 5월 3일
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?

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

추가 답변 (1개)

Anand
Anand 2013년 11월 18일
Or use the two argument syntax for histeq.
[histIm,T] = histeq(grayImage);
plot(T,'b-')
  댓글 수: 2
Image Analyst
Image Analyst 2013년 11월 18일
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 2013년 11월 18일
The result isnt "smooth" so I will take the first answer but thanks anyway

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

카테고리

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