Wallis微分算子

     模板为L=[    0, -log,   0;

                      -log, 4log,-log;

                        0, -log,   0]

      该模板是将Laplacian微分算子和对数算子结合的一种锐化算子。因为人眼对画面信号的处理过程中有一个近似的对数运算环节,解决了Laplacian微分算子对画面比较暗的部分锐化比较弱的缺陷。

%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,[]);