CANNY Function (PV-WAVE Extreme Advantage)

Applies the Canny edge-detection method to an image.

Usage

result = CANNY(image, ncoeffs, sigma)

Input Parameters

image—A 2D or 3D array of any type except string or complex.

ncoeffs—An integer value greater than 0 that specifies the number of coefficients in the Canny filter.

sigma—A floating point value greater than 0.0 that specifies the standard deviation used in the Canny operator.

Returned Value

result—A double array containing the filtered image.

Keywords

Intleave—A scalar string indicating the type of interleaving of 2D input signals and 3D image arrays. Valid strings and the corresponding interleaving methods are:

'pixel'—The input array arrangement is (pxy) for p  pixel-interleaved images of x-by-y.

'row'—The 3D image array arrangement is (xpy) for p  row-interleaved images of x-by-y.

'image'—The 3D image array arrangement is (xyp) for p  image-interleaved images of x-by-y.

Discussion

The Canny edge operator finds the local maxima in the gradient of the Gaussian-smoothed image. This is accomplished by applying a separable Gaussian gradient filter to image, and then determining local maxima from each 3-by-3 neighborhood of the gradient magnitude image. These maxima are returned in the output image, result, with all non-maximal pixels set to 0.

Example

; Read an image.
test_image = IMAGE_READ(!IP_Data +'objects.tif')
; Apply the Canny edge detection method.
edge_image = CANNY(test_image('pixels'), 40, 2.0)
; View the edges of the image.
TVSCL, edge_image

See Also

FILT_NONLIN,  SHIFT_EDGE

In the PV‑WAVE Reference: ROBERTS, SOBEL