FSOBEL -- Sobel Edge Filter (up to 3x3)

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

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

PARAMETERS

FSOBEL 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
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

MASK

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

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

FACTOR

  Valid Values:   x >= 0.00001
  Default:        1.0
Specifies the gain factor to be applied to the filtered input channel.

 EASI>FACTOR = 1.5
 EASI>FACTOR =          | defaults to 1.0
NOTE: Values of 0.0 or negative real numbers are not allowed.

DETAILS

Sobel edge detection produces an image where higher grey-level values indicate the presence of an edge between two objects. The Sobel Edge Detection filter computes the root mean square of two 3X3 templates. It is one of the most popular 3X3 edge detection filters. See ALGORITHM for more details about the filter.

There are five parameters in this program. FILE specifies the input PCI database file. Input channel (DBIC) can be the same as the output channel (DBOC). The user has the option of applying a gain factor (FACTOR) to each filtered input channel before averaging. A FACTOR of 1.0 (default) implies no gain.

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 Sobel edge detection filter uses the two 3X3 templates to calculate the gradient value.

        -1   0   1           1   2   1
        -2   0   2           0   0   0
        -1   0   1          -1  -2  -1

            X                    Y
Consider the following 3X3 image window

         +---------+
         | a1 a2 a3|
         | a4 a5 a6|     <---   Filter window 3 X 3
         | a7 a8 a9|
         +---------+
where:

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

    X = -1*a1 + 1*a3 - 2*a4 + 2*a6 - 1*a7 + 1*a9

    Y =  1*a1 + 2*a2 + 1*a3 - 1*a7 - 2*a8 - 1*a9

    Sobel gradient = SQRT (X*X + Y*Y)
All pixels are filtered. In order to filter pixels located near the edges of an image, edge pixels values are replicated to give sufficient data.

EXAMPLE

Using the PCI demo file irvine.pix to calculate the Sobel edge detection gradient.

 EASI>FILE = "irvine.pix"
 EASI>DBIC = 1  
 EASI>DBOC = 8                  | Working area
 EASI>MASK = 11                 | Bitmap 11
 EASI>FACTOR = 1
 EASI>RUN FSOBEL

About PCI Help Gateway