| 查看: 396 | 回复: 0 | ||
[求助]
这个高斯滤波器的程序为何输不出滤波后的图像,程序有什么错?
|
|
I= imread('F:\rise.jpg'); [N,M]=size(I); figure; subplot(1,2,1); imshow(I); title('原图像-rise'); n1=3;sigma1=0.5;n2=3;sigma2=0.5;theta=0; r=[cos(theta) -sin(theta); sin(theta) cos(theta)]; for i = 1 : n2 for j = 1 : n1 u = r*[j-(n1+1)/2 i-(n2+1)/2]'; h(i,j)=exp(-u(1)^2/(2*sigma1^2))/(sigma1*sqrt(2*pi))*exp(-u(2)^2/(2*sigma2^2))/(sigma2*sqrt(2*pi)); end end h = h / sqrt(sum(sum(h.*h))); f1=conv2(I,h,'same'); t=ones(N,M); t=f1; for i=2:N-1 for j=2:M-1 f1(i,j)=t(i+1,j)+t(i-1,j)+t(i,j+1)+t(i,j-1)-4*t(i,j);%二维拉普拉斯算子 end end subplot(1,2,2); imshow(f1); title('Laplacian边缘检测(高斯滤波后)—rise'); |
» 猜你喜欢
遇见不省心的家人很难过
已经有17人回复
退学或坚持读
已经有25人回复
博士延得我,科研能力直往上蹿
已经有4人回复
免疫学博士有名额,速联系
已经有14人回复
面上基金申报没有其他的参与者成吗
已经有4人回复
多组分精馏求助
已经有6人回复













回复此楼
点击这里搜索更多相关资源