资源简介
实时坏点检测算法和基于梯度的坏点修复算法
代码片段和文件信息
function J = bpc2(I)
% Chan Dead pixel real-time detection method for image.
% I = double(I)/255;
% T = 0.18;
% Order7 = ordfilt2(I 7 [10101;00000;10001;00000;10101]);
% Order2 = ordfilt2(I 2 [10101;00000;10001;00000;10101]);
% Abs = max(Order7-Order2 T);
% Ave = imfilter(I [10101;00000;10001;00000;10101] ‘symmetric‘);
% Ave = (Ave-Order7-Order2)/6;
% Upper = Ave + Abs;
% Lower = Ave - Abs;
% ind = I > Upper | I < Lower;
% I(ind) = Ave(ind);
% J = uint8(I*255);
I = double(I);
[mn] = size(I);
for i = 3:m-2
for j = 3:n-2
A = [I(i-2j-2)I(i-2j)I(i-2j+2)I(ij-2)I(ij+2)...
I(i+2j-2)I(i+2j)I(i+2j+2)];
B = sort(A);
ABS = max(abs(B(7)
评论
共有 条评论