資源簡介
matlab 的 Difference of Gaussian 算法實現,很常用的算法
代碼片段和文件信息
clc
clear
%DoG濾波器
p2?=?input(‘模板尺寸p2=\n‘);
display(‘DoG算子的方差設置?方差1<方差2‘)
sigma1?=?input(‘方差1?sigma1=\n‘);
sigma2?=?input(‘方差2?sigma2=\n‘);
siz?=?(p2-1)/2;
[xy]?=?meshgrid(-siz(1):1:siz(1)-siz(2):1:siz(2));
z1?=?exp(-(x.*x+y.*y)/(2*sigma1.^2))/sqrt(2*pi*sigma1.^2);
z2?=?exp(-(x.*x+y.*y)/(2*sigma2.^2))/sqrt(2*pi*sigma2.^2);
z3?=?z1?-z2;
figure
mesh(xyz1)
hold?on
mesh(xyz2)
Inimage?=?imread(‘aa.bmp‘);
figure
imshow(Inimage)
Inimage?=?rgb2gray(Inimage);
Resimage?=?conv2(Inimage?z3‘full‘);
Resimage?=?mat2gray(Resimage);
figure
imshow(Resimage)
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件?????387042??2008-01-19?21:06??DoG?filters\aa.bmp
?????文件????????607??2008-01-19?21:07??DoG?filters\DoG_filter.m
?????目錄??????????0??2011-09-19?09:49??DoG?filters
-----------?---------??----------?-----??----
???????????????387649????????????????????3
評論
共有 條評論