Canny Edge Detection

#include "BIVISION.H"

 

HANDLE CALLBACK  FilterEdgeCanny( HANDLE   hSrcDIB,
WORD       nSTDV,
BOOL        bShowDialog)

Description

This function will find edges on the input image by the Canny edge detection method. This function works for 8 and 24 bit per pixel images. Canny edge-detection first filters the image with the derivative of the Gaussian filter mask generated by the standard deviation parameter. The value of standard deviation determines the width of the filter matrix, and controls the amount of smoothing produced by the Gaussian component. The derivative Gaussian filtering will smooth the image and enhance the edges. After filtering the magnitude of the result x and y components is to be computed. The final step of Canny edge-detector is a nonmaximum suppression step, where pixels that are not local maxima are removed. During the nonmaximum suppression step a hysteresis thresholding is applied.

Examples

edge                 edgecanny

The original 500 x 400 pixel image and the Canny edge detected image with fSTDV = 1.5, parameter value.

Parameters

HANDLE

hSrcDIB

Source DIB

WORD

nSTDV

Standard deviation value. The value of standard deviation determines the width of the filter matrix, and controls the amount of smoothing produced by the Gaussian component. STDV cannot be less than 0. See the description and examples above for further information and a possible value.

BOOL

bShowDialog

This parameter specifies the displaying of the preview dialog.

IMPORTANT:     The preview dialog will only display, if there is BiDlgs.dll installed.

Return values

Handle of the newly created DIB on success or NULL on failure.

Programming notes

Requirements

Header :     Declared in BiVision.h; include BiVision.h.

Library :    Use BiVision.lib.

DLLs :       BiVision.dll.