我打算在matlab中执行高斯边缘算子的拉普拉斯算子..
这是我所拥有的知识
LOG operators are second-order deriatives operator. Second order deriatives operator result in zero-crossing. At the step, position where 1st deriative is maximum is where the second deriative has zero crossing.
我使用的掩码是 mask = [0 1 0; 1 -4 1; 0 1 0];
原图是
我得到的输出来自原始图像
我的问题是为什么图像中的边缘看起来是白色而不是黑色(= 0)。应该是黑色的吗?我是对还是错?谁能解释一下?
卷积函数:
function [ I2 ] = image_convolution(I,w,G)
m= (w-1)/2;
N= size(I,1);
M=size(I,2);
for i=1:N
for j=1:M
if (i > N-m-1 || j > M-m-1 || i<m+1 || j <m+1)
I2(i,j) = 0;
continue;
end
sum1 = 0;
for u=1:w
for v=1:w
sum1 = sum1+I(i+u-m-1,j+v-m-1)*G(u,v);
end
end
I2(i,j)=sum1;
end
end
end