Histogram equalization function
问题 I'm trying to implement the histogram equalization using this code: clc A=input('please enter image adress','s'); Iimg=imread(A); Iimg1=double(Iimg); histi=imhist(Iimg); mmax=max(Iimg1(:)); h=histi/numel(Iimg1) cdf=cumsum(h) cdf=cdf*double(mmax); c=uint8(cdf); subplot(1,3,1) bar(c) subplot(1,3,2) imhist(Iimg) subplot(1,3,3) imhist(histeq(Iimg)) Is my code wrong? I don't get expected results. 回答1: I get this from your code: What is wrong? unless your image is rgb , the code works (I used