User's Guide

EDGEX

Performs edge extraction on an image by using gradient filtering.

Function:

EDGEX performs edge extraction on an image by applying a gradient operator which accentuates regions of rapid change and then applys a thresholding, resulting in an edged image. The edges that are extracted form the output image. EDGEX can be used to extract the edges of prominent image features such as roads and coastlines.

Parameters:

IN
Input image. This image or any specified window must contain at least 3 lines and 3 samples per line. Only BYTE data is allowed. Multiple images are not allowed.

OUT
Output image. Contains the extracted edges from the input image. These edges have the value specified by PIXVAL and all other pixels have a value of zero. OUT has the same number of lines, samples, and bands, and the same data type as the input image.

THRVAL(--)
Threshold value. THRVAL is used to eliminate noise such as clouds. Pixels greater than THRVAL are not considered in the calculations. If NULL, all pixels are considered in the edge calculations.

EDGEVAL(0.05)
Edge value. The fraction of pixels to be classified as edges. Values outside the range 0.05 to 0.30 are unlikely to give good results.

PIXVAL(255)
Pixel value. The pixel value used for the edges in the output image.

Examples:

  1. LAS> edgex in=inimg out=outimg

    The input file INIMG;IMG is processed with the default THRVAL and EDGEVAL. All of the input image pixels are used in calculation of the edges, and 5/100 of the pixels will be output as edges. The edge image is written to OUTIMG;IMG with edge pixel values of 255.

  2. LAS> edgex in=inimg out=outimg pixval=100

    The input file INIMG;IMG is processed with the default THRVAL and EDGEVAL. All of the input image pixels are used in calculation of the edges, and 5/100 of the pixels will be output as edges. The edge image is written to OUTIMG;IMG with edge pixel values of 100.

  3. LAS> edgex in=inimg out=outimg thrval=200 edgeval=0.2

    The input file INIMG;IMG is processed with a THRVAL of 200 and an EDGEVAL of 0.2. Two tenths of the input image pixels will be output as edges. Only pixels with a value less than or equal to 200 are processed. The edge image is written to OUTIMG;IMG with edge pixel values of 255.

Description/Algorithm:

EDGEX extracts the edges from IN by applying a spatial gradient operator that accentuates regions of rapid pixel value changes according to the following formula that finds the maximum of vertical and horizontal gradients:


Input image
neighborhood:	p1 p2 p3
		p4 p5 p6
		p7 p8 p9

p5' = MAX(|p1+p2+p3-p7-p8-p9|,
	  |p1+p4+p7-p3-p6-p9|)

where p1 through p9 are input pixels and p5' is the corresponding output pixel.

This formula compares three samples from one line with three samples from the preceding and following lines. If any of the pixel values is greater than THRVAL, this set of pixel values is not used in the comparison. The comparison creates an enhanced pixel value using the above algorithm. The enhanced pixel values are histogramed and placed in a temporary image. EDGEVAL and the histogram are used to find the largest pixel value (nonedge) that will generate EDGEVAL edge pixel values. The enhanced image's pixels that are greater than non-edge are output to the written image as PIXVAL; the rest are output as zero.

Nonfatal Error Message:

  1. [edgex-warn] Nonfatal error encountered

    The error message that is displayed immediately preceding this message is the specific error encountered. Processing continues.

Fatal Error Messages:

  1. [edgex-alloc] Error allocating dynamic memory

    An error occurred while allocating dynamic memory for processing. Rerun the function. If the error reoccurs, notify the system manager.

  2. [edgex-fatal] Fatal error encountered

    The error message that is displayed immediately preceding this message is the specific error encountered. Processing is terminated.

  3. [edgex-type] Only BYTE images allowed

    IN must be a BYTE image. Respecify IN.

  4. [edgex-wind] Windowed image size is smaller than 3x3

    The input window must contain at least three lines with three samples per line. Respecify the input window or image.

User Notes:

  1. EDGEX will only accept images of BYTE data type.

  2. EDGEX can be used in conjunction with such programs as TICMARK to assist in image positioning.