No BSD License  

Highlights from
Gradient using first order derivative of Gaussian

4.27273

4.3 | 11 ratings Rate this file 95 Downloads (last 30 days) File Size: 1.63 KB File ID: #8060
image thumbnail

Gradient using first order derivative of Gaussian

by Guanglei Xiong

 

19 Jul 2005 (Updated 09 Sep 2005)

Output the gradient image of a grayscale image

| Watch this File

File Information
Description

[gx,gy]=gaussgradient(IM,sigma) outputs the gradient image gx and gy of
image IM using a 2-D Gaussian kernel. Sigma is the standard deviation of
this kernel along both directions.

Required Products Image Processing Toolbox
MATLAB release MATLAB 7 (R14)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (14)
16 Sep 2005 H N

Image processing toolbox is not required if you use conv2 instead of imfilt.

25 Nov 2005 Michal Kujalowicz

Theare is a problem with fim=mat2gray(im); instruction,in "testgaussgradient.m" (matlab R14)I got "matrix im should be a double error".
It can be solved by adding im=double(im);
after reading image (3 line)

06 Jul 2006 renuka patnaik

there was a problem using the function imshow(fim(1:50,1:50),'InitialMagnification','fit'); in 'fit'

19 Sep 2008 masha yusrina

there was a problem using the function imshow(fim(1:50,1:50),'InitialMagnification','fit'); in 'fit'

i can't solve it

02 Oct 2008 Andrea Tagliasacchi

Works perfectly it seems, Thanks

10 Feb 2009 Prakash Manandhar  
23 Apr 2009 Yaroslav Bulatov  
12 Jun 2009 hbu 

good

10 Aug 2009 samur piere

can you mention the mathematical basis for kernel size and normalization steps. thx.

epsilon = 1e-2;
halfsize = ceil( sigma * sqrt(-2*log(sqrt(2*pi)*sigma*epsilon)) );

hx = hx/sqrt(sum(sum( abs(hx).*abs(hx) )));

13 Aug 2009 Gustaf Kylberg

Seems like you are calculating too small kernel sizes when higher values of sigma are used, e.g., when sigma>10 the kernels are clearly truncated. With sigma>40 your kernel size becomes imaginary.

04 Jan 2010 Karthik Muthuswamy

Real nice work!!!

07 Jan 2010 Karthik Muthuswamy

Can you add the paper/text you had referred to calculate the kernels in your code. Thanks!

22 Mar 2010 Ernesto

thanks, it show clearly gx and gy

18 Nov 2011 Yad prab

Hey, nice job man! I can easily visulaize the variations in my image.
But what if i m in 3D. With image in 2D and a time factor that is adds to the third dimenstion ?

Please login to add a comment or rating.
Updates
09 Sep 2005

change Summary

Tag Activity for this File
Tag Applied By Date/Time
filtering Guanglei Xiong 22 Oct 2008 07:53:40
gradient gaussian Guanglei Xiong 22 Oct 2008 07:53:40
first order derivative Guanglei Xiong 22 Oct 2008 07:53:40
fod Guanglei Xiong 22 Oct 2008 07:53:40
image proc Guanglei Xiong 22 Oct 2008 07:53:40
filtering samur piere 10 Aug 2009 22:16:07
gradient gaussian samur piere 10 Aug 2009 22:16:11
gradient method Fabiano 09 Dec 2009 19:32:09

Contact us at files@mathworks.com