Gradients with Gaussian smoothing
These functions carry out gradient estimation using Gaussian smoothing and symmetric differencing. They can be used to support, for example, the Canny edge detector, and may form the initial stage of many image and data processing operations.
The gradient functions accept different kinds of data:
gradients_x: a vector
gradients_xy: a 2-D array, typically an image. The two components of the gradient are returned.
gradients_xyt: two 2-D arrays, each typically an image. Spatial and temporal gradients are returned.
gradients_n: an N-D array. The gradient along each axis is returned.
The supporting smoothing functions carry out Gaussian smoothing, taking as inputs:
gsmooth: a vector
gsmooth2: a 2-D array
gsmoothn: an N-D array
The functions offer anisotropic smoothing if required. (That is, a different smoothing constant for each axis.)
Particular care is taken of how elements close to the array boundaries are treated. By default, the output arrays are smaller than the input arrays so that only valid values need be computed. However, an option allows the outputs to be the same size as the inputs; values close to the boundaries are then computed by extrapolation of the image using reflection or tiling.
The convenience function exindex simplifies the code for extrapolation.
引用格式
David Young (2024). Gradients with Gaussian smoothing (https://www.mathworks.com/matlabcentral/fileexchange/34089-gradients-with-gaussian-smoothing), MATLAB Central File Exchange. 检索来源 .
MATLAB 版本兼容性
平台兼容性
Windows macOS Linux类别
- Image Processing and Computer Vision > Image Processing Toolbox > Image Filtering and Enhancement > Image Filtering >
标签
致谢
启发作品: Affine optic flow
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!版本 | 已发布 | 发行说明 | |
---|---|---|---|
1.6.0.0 | Included checkattributes() in the submission (previously omitted in error). |
||
1.5.0.0 | Nearest-neighbour differencing added as an option. Some changes to argument sequences - region and wrapping now given as name-value parameters. |
||
1.4.0.0 | Extended to cover N-D and 1-D data. |
||
1.3.0.0 | Fixed bug that caused an error when the default region was used. |
||
1.1.0.0 | Updated to include user-friendly same size option and change to the argument order. |
||
1.0.0.0 |