【发布时间】:2012-04-25 00:24:14
【问题描述】:
我打算在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
【问题讨论】:
-
你在使用 imshow 来绘制你的图像吗?
-
ya..我正在使用 imshow...
-
它们应该是白色的。您使用的内核仅适用于“拉普拉斯算子”。顾名思义,高斯的拉普拉斯算子,首先取图像的高斯。为什么你不能在谷歌上搜索一次?真的值得在论坛上提问吗?无论如何..这是link。