Is there any Difference of Gaussians function in Matlab?

狂风中的少年 提交于 2019-11-30 15:23:56

问题


I am new to Image Processing, and in my experiment I am having difficulty with Difference of Gaussians. Various implementation were given to me but I don't understand them and their parameters.

Here are my formulas

Should I implement this filtering myself, or is there an existing function defined for this? Of course with all parameters which are like in link. I will need to play with parameters and produce different images.


回答1:


You could Gaussian filter an image twice with two different std. dev. and just subtract them, would be the same as using the combined filter.

k = 10;
sigma1 =  0.5;
sigma2 = sigma1*k;

hsize = [3,3];

h1 = fspecial('gaussian', hsize, sigma1);
h2 = fspecial('gaussian', hsize, sigma2);

gauss1 = imfilter(img,h1,'replicate');
gauss2 = imfilter(img,h2,'replicate');

dogImg = gauss1 - gauss2;


来源:https://stackoverflow.com/questions/20057146/is-there-any-difference-of-gaussians-function-in-matlab

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!