FED -- Edge Detection Filter (up to 33x33)

Performs EDGE DETECTION filtering for Image data. The edge detection filter creates an image where edges (sharp changes in grey-level values) are shown.

Progress of this program can be monitored. See MONITOR section.

See Also: FAV, FME, FGA, FMO, FPR, FAD, FLE, FSOBEL, FPRE, FSHARP

PARAMETERS

FED is controlled by the following global parameters:

Name     Prompt                                  Count     Type
FILE     Database File Name                      1-64      Char
DBIC     Database Input Channel List             1         Int
DBOC     Database Output Channel List            1         Int
FLSZ     Filter Size: Pixels, Lines              1-2       Int
MASK     Area Mask (Window or Bitmap)            0-4       Int
FACTOR   Gain Factor                             0-1       Real

FILE

Specifies the name of the PCIDSK file containing channels to be filtered.

 EASI>FILE="filespec"

DBIC

Specifies the input channel to be filtered.

 EASI>DBIC=i

DBOC

Specifies the output channel for the filtered result.

 EASI>DBOC=j

FLSZ

Specifies the filter size in units of pixels and lines:

 EASI>FLSZ=i,j

MASK

Specifies the area in the input channel which should be processed. This can be one of the following:

 EASI> MASK =                           | process entire channel
 EASI> MASK = xoff,yoff,xsize,ysize     | process window
 EASI> MASK = b                         | process only under bitmap
                                        | stored in segment b

FACTOR

  Valid Values:   x >= 0.000001
  Default:        1.0
Specifies a gain multiplication factor to be applied to the input channel.

Values of 0.0 or negative real numbers are not allowed.

 EASI>FACTOR = 1.5
 EASI>FACTOR =          | defaults to 1.0

DETAILS

The Edge Detection filter computes the mean of the absolute difference between the grey-level value at the central pixel and at each of its neighbours within the filter window. The dimensions of the filter window must be odd. The minimum filter size is 1 by 3, and the maximum filter size allowed is 33 by 33. The filter window does not need to be square. Edge detection filtering produces an image where higher grey-level values indicate the presence of an edge between two objects. The user has the option of applying a factor to each input channel before averaging. A gain factor of 1.0 (default) implies no gain factor.

The MASK parameter specifies the area within the input channel which will be processed. Only the area under mask will be filtered and the rest of the image will be unchanged. If a single value is specified, then this value points to a bitmap segment, which defines the area to be filtered. When four values are specified, these values define the x,y offsets and x,y dimensions of the rectangular window within the image to be filtered. If MASK is defaulted, the entire database is processed.

MONITOR

Program progress can be monitored by printing the percentage of completed processing in odometer fashion. A system parameter, MONITOR, controls this activity:

 EASI>MONITOR="ON"           | turn monitor ON  (default)
 EASI>MONITOR="OFF"          | turn monitor OFF (recommended if
                             | running in batch/background mode)

ALGORITHM

The Edge Detection filter computes the mean of the absolute difference between the grey-level value at the central pixel and at each of its neighbours within the filter window.

All pixels are filtered. In order to filter pixels located near the edges of the image, edge pixel values are replicated to give sufficient data.

         +---------+
         | a1 a2 a3|
         | a4 CT a5|     <---   Filter window 3 X 3
         | a6 a7 a8|
         +---------+
The edge detection filter finds edge pixel values in the filter window. The filtered pixel is the sum of the absolute differences between the center pixel (CT) and the surrounding pixels in the filter window, divided by the number of pixels surrounding the central pixel (8).

     filtered pixel CT = SUM (ABS(CT-a1) +...+ ABS(CT-a8)) / 8
where

        a1 .. a8   are grey levels of each pixel in filter window

        CT         is the grey-level value of central pixel
Example of using filter 5x5 on database image 8x8, FACTOR = 1.0

   Image before filtering           Image after filtering

   8 8  8 9 9 9 7 6 6 6   6 6
   8 8  8 9 9 9 7 6 6 6   6 6
       +----------------+           +----------------+
   8 8 |8 9 9 9 7 6 6 6 | 6 6       |1 2 3 4 4 2 0 0 |
   8 8 |8 9 9 7 6 6 6 6 | 6 6       |2 2 4 4 3 1 0 0 |   
   9 9 |9 8 8 6 6 6 6 6 | 6 6       |3 3 3 4 2 1 0 0 |
   9 9 |9 8 7 7 6 5 6 6 | 6 6       |4 3 3 3 1 3 0 0 |
   7 7 |7 7 7 6 6 6 6 6 | 6 6       |3 3 3 1 1 0 0 0 |
   6 6 |6 6 6 6 6 6 6 6 | 6 6       |2 2 1 1 1 0 0 0 |   
   6 6 |6 6 6 6 6 6 6 5 | 5 5       |1 1 0 0 0 0 0 3 |
   6 6 |6 6 6 6 6 6 6 6 | 6 6       |0 0 0 0 0 0 0 0 |
       +----------------+           +----------------+        
   6 6  6 6 6 6 6 6 6 6   6 6      
   6 6  6 6 6 6 6 6 6 6   6 6
In the "Image before filtering" on the left, columns and scanlines outside the box represent the last image column or scanline being reused, for the case where the filter does not have a full window.

EXAMPLE

A 5 by 5 edge detection filter is used under bitmap 11 (Urban area), on 8-bit database channel 4 (Near Infra-Red), using IRVINE.PIX file.

 EASI>FILE = "IRVINE.PIX"
 EASI>DBIC = 4                  | Near IR
 EASI>DBOC = 8                  | Working area
 EASI>FLSZ = 5,5                | Edge Detection Filter 5x5
 EASI>MASK = 11                 | Bitmap 11
 EASI>RUN FED
A 5 by 5 edge detection filter is used under 16-bit sign database channels 10 (which contains elevation data), using IRVINE.PIX file. Output channel equal input channel.

 EASI>FILE = "IRVINE.PIX"
 EASI>DBIC = 10                 | Elevation data
 EASI>DBOC = 10                 
 EASI>FLSZ = 5,5                | Edge Detection Filter 5x5
 EASI>MASK =                    | Entire database
 EASI>RUN FED

About PCI Help Gateway