close all;
clear all;
clc;
I=imread('source.jpg');
[m,n]=size(I);
cal=zeros(256,1);
J=zeros(m,n);
for i=1:m
for j=1:n
cal(I(i,j)+1)=cal(I(i,j)+1)+1;
end
end
pro=cumsum(cal)/(m*n);
max=max(max(I));
min=min(min(I));
for i=1:m
for j=1:n
J(i,j)=pro(I(i,j)+1)*(max-min)+min;
end
end
subplot(121);
imshow(I);
subplot(122);
imshow(J,[]);
直方图均衡化matlab
最新推荐文章于 2021-06-13 15:24:26 发布