Shen-Castan Edge Detection

#include "BIVISION.H"

 

HANDLE CALLBACK  FilterEdgeSC( HANDLE   hSrcDIB,
float            fSF,
int               iLow,
int               iHigh,
float            fRatio,
int               iThinFactor,
int               iWndSize,
BOOL        bDoHysteresis
BOOL        bShowDialog)

Description

This function will find edges on the input image by the Shen-Castan edge detection method. This function works for 8 and 24 bit per pixel images. Shen-Castan edge detector uses an optima filter function called Infinite Symmetric Exponential Filter (ISEF). This produces better signal to noise ratios and better localisation than Canny. First step is convolving the input image with the ISEF, then localization edges by zero crossing of the Laplacian (similar to the Marr-Hildreth algorithm). The approximation of Laplacian is computed by subtracting the original image from the smoothed one. The result is a band-limited Laplacian image. Next, a binary Laplacian image is generated by setting all the positive valued pixels to 1 and all others to 0. The candidate pixels are on the boundaries of the regions in th binary image. After improving the quality of edge pixels by false zero-crossing suppression, adaptive gradient thresholding and a hysteresis thresholding is applied finally.

Examples

edge                 edgeshencastan

The original 500 x 400 pixel image and the Shen-Castan edge detected image with fSF = 0.8, iLow = 20, iHigh = 22, fRatio = 0.99, iThinFactor = 0, iWndSize = 7 and bDoHysteresis = TRUE parameter values.

Parameters

HANDLE

hSrcDIB

Source DIB

float

fSF

Smoothing factor used by the IESF filtering. See the description and examples above for further information and a possible value.

int

iLow

Low threshold value of hysteresis thresholding. See the description and examples above for further information and a possible value.

int

iHigh

High threshold value of hysteresis thresholding. See the description and examples above for further information and a possible value.

float

fRatio

This parameter specifies the percents of pixels above the hysteresis thresholding. See the description and examples above for further information and a possible value.

int

iThinFactor

Thinning factor (number of pixels). See the description and examples above for further information and a possible value.

int

iWndSize

Size of window used by gradient thresholding. See the description and examples above for further information and a possible value.

BOOL

bDoHysteresis

Do hysteresis thresholding with iLow and iHigh threshold values.

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.