Wallis微分算子
%Wallis微分算子 clear all; I=imread('lena.bmp'); %figure %imshow(I); I=im2double(I); [height width R]=size(I); for i=2:height-1 for j=2:width-1 II(i,j)=log10(I(i,j)+1)-0.25*(log10(I(i-1,j)+1)+log10(I(i+1,j)+1)+log10(I(i,j-1)+1)+log10(I(i,j+1)+1)); end end min1=min(II); min2=min(min1); for i=2:height-1 for j=2:width-1 II(i,j)=46*II(i,j)-min2+0.4; end end %figure %imshow(II,[]); for i=1:height-1 for j=1:width-1 if (II(i,j)<-0.035) II(i,j)=0; else II(i,j)=1; end end end figure; imshow(II,[]);
%Wallis微分算子 clear all; I=imread('lena.bmp'); %figure %imshow(I); I=im2double(I); [height width R]=size(I); for i=2:height-1 for j=2:width-1 II(i,j)=log10(I(i,j)+1)-0.25*(log10(I(i-1,j)+1)+log10(I(i+1,j)+1)+log10(I(i,j-1)+1)+log10(I(i,j+1)+1)); end end min1=min(II); min2=min(min1); for i=2:height-1 for j=2:width-1 II(i,j)=46*II(i,j)-min2+0.4; end end %figure %imshow(II,[]); for i=1:height-1 for j=1:width-1 if (II(i,j)<-0.035) II(i,j)=0; else II(i,j)=1; end end end figure; imshow(II,[]);