Edge
Detect edges in image
1. imgedge t:=10; 2. imgedge t:=7 f:=shv img:=mat(1) oimg:=mat(2);
Please refer to the page for additional option switches when accessing the x-function from script
Input
int
Specifies the threshold value used to determine edge pixels. If the difference determined for a pixel is greater than this value, the pixel will be an edge pixel.
Image
Specifies the image to be manipulated. The default input is the active image.
Output
Specifies the output image. By default, the output image is the same as the input image. See the syntax here.
Specifies which edge detection filter to apply.
Option list
Detects northeast edges with gradient filter.
The imgEdge function detects edges in the input image using edge filters. Many types of filters are available for you to choose to process different images.
This X-Function works for both color images and grayscale images.
// Subtract background from a cell image then detect the cell edges. //Create a new folder in the Project Explorer pe_mkdir EdgeDetection path:=aa$; pe_cd aa$; //Create a matrix and import the cell image into it window -t m; fname$ = System.path.program$ +"samples\Image Processing and Analysis\cell.jpg"; impimage; CellBk$ = %h; //Create a matrix and import the background image into it window -t m; fname$ = System.path.program$ +"samples\Image Processing and Analysis\bgnd.jpg"; impimage; //Subtract background and pre-processing imgSimpleMath img2:=cellbk$ func:=4 x:=7 y:=13 crop:=1; imgBinary t1:=65 t2:=255; imgMedian d:=18; //Edge detection imgEdge t:=12 f:=shv; //Add the edges back to the cell image imgSimpleMath img2:=cellbk$ func:=3; window -z; //Maximize window
The computation uses L_EdgeDetectorBitmap() function from LEADTOOLS Main API. Please refer to the LEADTOOLS Main API Help file, Version 14 and read the L_EdgeDetectorBitmap topic.
LEADTOOLS Main API Help file, Version 14
imgUserfilter