声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 1213|回复: 1

急!看不明白这一程序

[复制链接]
发表于 2006-4-11 16:45 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?我要加入

x
% Function "d2gauss.m":<BR>% This function returns a 2D Gaussian filter with size n1*n2; theta is <BR>% the angle that the filter rotated counter clockwise; and sigma1 and sigma2<BR>% are the standard deviation of the Gaussian functions.<BR>function h = d2gauss(n1,std1,n2,std2,theta)<BR>r=[cos(theta) -sin(theta);<BR>   sin(theta)  cos(theta)];<BR>for i = 1 : n2 <BR>    for j = 1 : n1<BR>        u = r * [j-(n1+1)/2 i-(n2+1)/2]';<BR>        h(i,j) = gauss(u(1),std1)*gauss(u(2),std2);<BR>    end<BR>end<BR>h = h / sqrt(sum(sum(h.*h)));<BR><BR>% Function "gauss.m":<BR>function y = gauss(x,std)<BR>y = exp(-x^2/(2*std^2)) / (std*sqrt(2*pi));<BR>
回复
分享到:

使用道具 举报

发表于 2006-4-11 21:48 | 显示全部楼层

回复:(快乐abcde)急!看不明白这一程序

<P>请具体说明什么地方看不明白</P>
您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

QQ|小黑屋|Archiver|手机版|联系我们|声振论坛

GMT+8, 2024-10-4 23:23 , Processed in 0.082536 second(s), 18 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表