Here are two ways that works ok with simple images:
procedure TForm1.EdgeDetect1Click(Sender: TObject);
{ Perform an edge detect using Sobel filter }
begin
ImageEnView2.Assign(ImageEnView1);
ImageEnView2.Proc.SaveUndo();
{ Perform an edge detect using Sobel filter }
ImageEnView2.Proc.EdgeDetect_Sobel;
{ ConvertToBWThreshold to make result black/white (with 1=edge) }
ImageEnView2.Proc.ConvertToBWThreshold(-2);
ImageEnView2.Fit;
end;
procedure TForm1.EdgeDetect2Click(Sender: TObject);
begin
ImageEnView3.Assign(ImageEnView1);
ImageEnView3.Proc.SaveUndo();
{ EdgeDetect_ShenCastan converts the current color image to black/white
(1 bit) with a Shen-Castan (ISEF) edge detection algorithm.
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).
procedure EdgeDetect_ShenCastan(Ratio:double; Smooth:double; WindowSize:
Integer; ThinFactor: Integer; DoHysteresis: Boolean);
Ratio: percent of pixels to be above High threshold (suggested 0.99)
Smooth: Smoothing factor (suggested 0.9)
WindowSize: Size of window for adaptive gradient (suggested 7)
ThinFactor: Thinning factor (suggested 0)
DoHysteresis: If True turn on the hysteresis thresholding (suggested True) }
ImageEnView3.Proc.EdgeDetect_ShenCastan(0.99, 0.9, 7, 0, True);
ImageEnView3.Fit;
end;

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development