ImageEn, unit imageenproc

TImageEnProc.EdgeDetect_ShenCastan

TImageEnProc.EdgeDetect_ShenCastan


Declaration

procedure EdgeDetect_ShenCastan(Ratio: Double = 0.99; Smooth: Double = 0.9; WindowSize: Integer = 7; ThinFactor: Integer = 0; DoHysteresis: Boolean = true);


Description

Convert the current color image to black & white (1 bit) using a Shen-Castan (ISEF) edge detection algorithm.
The Shen-Castan algorithm convolves the image with the Infinite Symmetric Exponential Filter, computes the binary Laplacian image, suppresses false zero crossing, performs adaptive gradient thresholding, and, finally, also applies hysteresis thresholding. (Algorithms for Image Processing and Computer Vision - J.R.Parker).

Parameter Description
Ratio Percent of pixels to be above High threshold (recommended: 0.99)
Smooth Smoothing factor (recommended: 0.9)
WindowSize Size of window for adaptive gradient (recommended: 7, max: 50)
ThinFactor Thinning factor (recommended: 0)
DoHysteresis If True tun on the hysteresis thresholding (recommended: True)

Note: Edge detection is performed on entire image. It is not affected by any selection


Demos

Demo  Demos\ImageEditing\CompleteEditor\PhotoEn.dpr
Demo  Demos\ImageEditing\EveryMethod\EveryMethod.dpr


Method Comparison

ImageEnView1.IO.LoadFromFile( 'D:\TestImage.jpg' );

  


// Convert the current color image to black & white (1 bit) using a Shen-Castan (ISEF) edge detection algorithm
ImageEnView1.Proc.EdgeDetect_ShenCastan();

  


// Detect the edges of objects within an image using a Sobel filter
ImageEnView1.Proc.EdgeDetect_Sobel();