Marr-Hildreth Edge Detection

#include "BIVISION.H"

 

HANDLE CALLBACK FilterEdgeMH( HANDLE hSrcDIB,
float           fSTDV,
BOOL       bStrictEdges,
BOOL       bMeanGauss,
int              bShowDialog)

Description

This function will find edges on the input image by the Marr-Hildreth edge detection method. This function works for 8 and 24 bit per pixel images. Marr-Hildreth edge-detection first filters the image with the Laplacian of the Gaussian filter matrix, which is computed by the standard deviation value input. The value of standard deviation determines the width of the filter matrix, and controls the amount of smoothing produced by the Gaussian component. The Laplacian of the Gaussian filtering will smooth the image and enhance the edges. After filtering edge localization is processed by finding zero crossings at each pixel for all directions.

Examples

edge                 edgemh

The original 500 x 400 pixel image and the Marr-Hildreth edge detected image with fSTDV = 2.0, bStirctEdge = TRUE and bMeanGauss = FALSE parameter values.

Parameters

HANDLE

hSrcDIB

Source DIB

float

fSTDV

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

bStrictEdges

This parameter specifies the strictness of edge detection. If it’s TRUE, less but stronger edges will be found. It’s important that in case of strict edges, it can be possible that no edges will be appeared. If does, choose a larger STDV value.

BOOL

bMeanGauss

If this parameter is turned on, a smoothed Gaussian kernel will be used during the convolution, and less edges will be found, but a cleaner image will be produced.

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.