I=imread('Capture.PNG');
[counts1,edges1]=histcounts(I(:,:,1),linspace(0,1,256));
[counts2,edges2]=histcounts(I(:,:,2),linspace(0,1,256));
[counts3,edges3]=histcounts(I(:,:,3),linspace(0,1,256));
figure, plot(edges1(1:end-1),counts1,'r')
figure, plot(edges2(1:end-1),counts2,'g')
figure, plot(edges3(1:end-1),counts3,'b')
mean_counts = mean([counts1(:), counts2(:), counts3(:)], 2);
figure, plot(edges1(1:end-1),mean_counts)
J = histeq(I,mean_counts)
Best Answer