Code covered by the BSD License  

Highlights from
Image gradients with Gaussian smoothing

Be the first to rate this file! 27 Downloads (last 30 days) File Size: 11.36 KB File ID: #34089

Image gradients with Gaussian smoothing

by David Young

 

06 Dec 2011 (Updated 09 Dec 2011)

Image grey-level gradients are estimated using Gaussian smoothing followed by differencing.

| Watch this File

File Information
Description

The function gradients_xy carries out Gaussian smoothing followed by differencing as a way of estimating the spatial gradients of a grey-level image in the X and Y directions. This is the initial stage of the well-known Canny edge detector, but the gradients can be used for many other applications.

The function offers independent control of the smoothing parameters.

Particular care is taken of how pixels close to the image boundaries are treated. By default, the output gradient arrays are smaller than the image so that only valid values need be computed, but an option allows them to be the same size as the image. Values close to the boundaries are then computed by extrapolation of the image using reflection or tiling.

The function gradients_xyt takes two images, and uses their average to estimate spatial gradients and their difference to estimate temporal gradients.

The function gsmooth2 carries out Gaussian smoothing, and the convenience function exindex simplifies extrapolation.

Required Products Image Processing Toolbox
MATLAB release MATLAB 7.13 (2011b)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Please login to add a comment or rating.
Updates
07 Dec 2011

Updated to include user-friendly same size option and change to the argument order.

09 Dec 2011

Fixed bug that caused an error when the default region was used.

Tag Activity for this File
Tag Applied By Date/Time
image processing David Young 06 Dec 2011 08:47:06
image smoothing David Young 06 Dec 2011 08:47:06
gaussian smoothing David Young 06 Dec 2011 08:47:06
gradients David Young 06 Dec 2011 08:47:06
first derivative David Young 06 Dec 2011 08:47:06

Contact us at files@mathworks.com