| 查看: 417 | 回复: 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'); |
» 猜你喜欢
前几天时间戳更新了
已经有10人回复
面上项目没有好文章就没希望了吗?
已经有19人回复
重庆理工大学副校长遇刺身亡 传涉案副教授疑因积怨行凶
已经有5人回复
困死了
已经有8人回复
材料博士申请
已经有5人回复
还有课题组有博士名额吗
已经有6人回复
博士申请
已经有3人回复











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