:lol A=imread('C:\Downloads\011.JPG');
A=rgb2gray(A);
figure
imshow(A);
A=double(A);
[M,N]=size(A);
a=0.32;
xm=255/2;
f1=zeros(M,N);
for i=1:M
for j=1:N
if A(i,j)<xm
f1(i,j)=a*cos(pi*A(i,j)/(2*xm));
else
if A(i,j)==xm
f1(i,j)=a*cos(pi/2);
else
f1(i,j)=a*cos(pi-pi*(255-A(i,j))./2*(255-xm));
end
end
end
end
b=0.3;
d=0.05;
w=a*tan(-b/xm);
f2=zeros(M,N);
for i=1:M
for j=1:N
K=d.*sin(4.*pi.*A(i,j)./255);
f2(i,j)=(K+b).*cos(w)+A(i,j).*sin(w);
end
end
c=0.3;
f3=zeros(M,N);
for i=1:M
for j=1:N
R=c.*abs(A(i,j)./xm-1);
f3(i,j)=R.*cos(3*pi.*A(i,j)./255);
end
end
f4=zeros(M,N);
f4=f1+f2+f3;
f5=zeros(M,N);
for i=1:M
for j=1:N
f5(i,j)=255*(A(i,j)./255).^(1./(1+f4(i,j)));
end
end
f5=medfilt2(f5);
figure
imshow(mat2gray(f5));
运行十分良好 这个是运行后的图片这个是运行前的图片