数字图像处理,Lee滤波的C++ 实现


Lee滤波的matlab代码

%Lee filter for speckle noise reduction
%Authors : Jeny Rajan, Chandrashekar P.S
%Usage - lee(I)
%I is the noisy image (gray level image m x n x 1)

function [le]=lee2(I)
[x y z]=size(I);
I=double(I);
N=zeros(x,y,z);
for i=1:x
    for j=1:y
        % Checking first and last pixel of first row% 
        if (i==1 & j==1)
            mat(1)=0;
            mat(2)=0;
            mat(3)=0;
            mat(4)=0;
            mat(5)=I(i,j);
            mat(6)=I(i,j+1);
            mat(7)=0;
            mat(8)=I(i+1,j);
            mat(9)=I(i+1,j+1);
        end
        
        if (i==1 & j==y)
            mat(1)=0;
            mat(2)=0;
            mat(3)=0;
            mat(4)=I(i,j-1);
            mat(5)=I(i,j);
            mat(6)=0;
            mat(7)=I(i+1,j-1);
            mat(8)=I(i+1,j);
            mat(9)=0;
        end
        
        % Checking first and last pixel of last row% 
        if (i==x & j==1)
            mat(1)=0;
            mat(2)=I(i-1,j);
            mat(3)=I(i-1,j+1);
            mat(4)=0;
            mat(5)=I(i,j);
            mat(6)=I(i,j+1);
            mat(7)=0;
            mat(8)=0;
            mat(9)=0; 
        end
        
        if (i==x & j==y)
            mat(1)=I(i-1,j-1);
            mat(2)=I(i-1,j);
            mat(3)=0;
            mat(4)=I(i,j-1);
            mat(5)=I(i,j);
            mat(6)=0;
            mat(7)=0;
            mat(8)=0;
            mat(9)=0;
        end
        % Checking rest of the image%        
        if (i>1 & i1 & j

Kuan滤波的matlab代码

%Kuan filter for speckle noise reduction
%Usage - kuan(I)
%I is the noisy image (gray level image m x n x 1)

function [kn]=kuan(I)
[x y z]=size(I);
I=double(I);
for i=1:x
    for j=1:y
        % Checking first and last pixel of first row% 
        if (i==1 & j==1)
            mat(1)=0;
            mat(2)=0;
            mat(3)=0;
            mat(4)=0;
            mat(5)=I(i,j);
            mat(6)=I(i,j+1);
            mat(7)=0;
            mat(8)=I(i+1,j);
            mat(9)=I(i+1,j+1);
        end
        
        if (i==1 & j==y)
            mat(1)=0;
            mat(2)=0;
            mat(3)=0;
            mat(4)=I(i,j-1);
            mat(5)=I(i,j);
            mat(6)=0;
            mat(7)=I(i+1,j-1);
            mat(8)=I(i+1,j);
            mat(9)=0;
        end
        
        % Checking first and last pixel of last row% 
        if (i==x & j==1)
            mat(1)=0;
            mat(2)=I(i-1,j);
            mat(3)=I(i-1,j+1);
            mat(4)=0;
            mat(5)=I(i,j);
            mat(6)=I(i,j+1);
            mat(7)=0;
            mat(8)=0;
            mat(9)=0; 
        end
        
        if (i==x & j==y)
            mat(1)=I(i-1,j-1);
            mat(2)=I(i-1,j);
            mat(3)=0;
            mat(4)=I(i,j-1);
            mat(5)=I(i,j);
            mat(6)=0;
            mat(7)=0;
            mat(8)=0;
            mat(9)=0;
        end
        % Checking rest of the image%
        
        if (i>1 & i1 & j

frost滤波matlab代码

%Frost filter for speckle noise reduction
%Author : Jeny Rajan
function [ft]=frost(I)
% I is the noisy input image
tic
[x y z]=size(I);
I=double(I);
K=1;
N=I;
for i=1:x
    for j=1:y                              
        if (i>1 & i1 & j


参考资源:

【1】

你可能感兴趣的:(图像处理算法,图像处理算法)