• 大小: 2KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-06-04
  • 语言: Matlab
  • 标签: matlab  

资源简介

这是高斯差分滤波器 用matlab 来实现的

资源截图

代码片段和文件信息

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  DoGfilters\DoG filters\aa.bmp

     文件        607  2008-01-19 21:07  DoGfilters\DoG filters\DoG_filter.m

     目录          0  2012-05-03 00:01  DoGfilters\DoG filters

     目录          0  2012-05-03 00:01  DoGfilters

----------- ---------  ---------- -----  ----

               387867                    5


评论

共有 条评论