Morphological Filters

Morphological Filters

Average if range small Black (noise) filter Dilation filter Erosion filter Geometric filter Average if range large Middle filter Difference filter Peak filter RMS filter Standard deviation filter White (noise) filter

In the morphological filters included in DigImage, the intensity of a pixel in the resultant image is set to some nonlinear combination of itself and its surrounding pixels in the source image (cf. convolution filters which use a linear combination). For these morphological filters, the basic cell size which contributes to the final intensity is user-specifyable. The pixel intensities, Pij (i=0,m-1; j=0,n-1), are utilised in the following manner:

                 { Pij     If MAX(P00,P01,...) - MIN(P00,P01,...) > maxRange
           Pij = {
                 { (P00+P01+...)/(m*n) otherwise

This filter is designed to eliminate noise from relatively slowly varying regions of the image. If the range of intensities within the filtering cell is less than a user-specified limit, then a low pass convolution will be used. If the range exceeds the limit, convolution of successively smaller cells will be used until either the cell consists of only a single pixel or the range is satisfied.

                 { Pij     if MIN(P00,P01,...) > 0
           Pij = {
                 { 0       otherwise

The effect of this filter is to eliminate nose from a region with an intensity close to zero (black). For best results, it may be necessary to subtract a constant from the image first to ensure that the noise is close to zero.

           Pij =  MAX(P00,P01,...)

The effect of this filter is to eliminate 'islands' of low intensity and increase the size of 'islands' of high intensity.

           Pij =  MIN(P00,P01,...)

The effect of this filter is to eliminate 'islands' of high intensity and decrease the size of 'islands' of low intensity.

           Pij = (P00*P01*...)**(1/(m*n))

This filter has a low-pass characteristic with an emphasis towards low intensities. Clearly if one of the intensities within a cell is zero, then the resultant intensity will also be zero, so that islands of zero intensity will tend to grow.

                 { Pij     If MAX(P00,P01,...) - MIN(P00,P01,...) < maxRange
           Pij = {
                 { (P00+P01+...)/(m*n) otherwise

This filter is designed to act as a low pass filter on regions where the intensity is varying very rapidly, yet have no effect on more subtle variations. If the range of intensities within the filtering cell is more than a user-specified limit, then a low pass convolution will be used. If the range does not exceed the limit, then no further action will be taken.

           Pij = (MAX(P00,P01,...) + MIN(P00,P01,...)) / 2

This filter has a low pass character.

           Pij =  MAX(P00,P01,...) - MIN(P00,P01,...)

This filter has a high pass character and acts to accentuate the maximum gradients of intensity within an image.

                  { P_lo   if Pij < P_lo
           Pij =  { P_hi   if Pij > P_hi
                  { Pij    otherwise

where

           P_lo = MIN(P00,P01,...) excluding Pij
           P_hi = MAX(P00,P01,...) excluding Pij

The effect of this filter is to reduce the noise component of an image by eliminating extremum pixels.

           Pij =  SQRT((P00*P00 + P01*P01 + ...)/(m*n))

This filter has a low pass character similar to the low pass convolution filters, but utilising a root mean square average rather than the arithmetic average.

           Pij =  SQRT(P2 - P1*P1)

where

           P1 = (P00 + P01 + ...)/(m*n)

           P2 = (P00*P00 + P01*P01 + ...)/(m*n)

This filter has a high pass character. The central pixel is replaced with the standard deviation of all the pixels falling in the cell.

                 { Pij     if MAX(P00,P01,...) < 255
           Pij = {
                 { 0       otherwise

The effect of this filter is to eliminate nose from a region with an intensity close to 255 (white). For best results, it may be necessary to add a constant from the image first to ensure that the noise is close to 255.

Filter which buffer?

Any valid image buffer may be filtered. The buffer filtered will be made the current output buffer. If the buffer specified is in extended memory, then the buffer is first copied to buffer 0; after the filtering is finished, the result will be copied back to the extended memory buffer.

Filter Window or whole Screen ?

The chosen filter may be applied applied to either a window or the entire screen. The computation required depends on the number of pixels to be filtered, so the size of the region to be filtered will dictate the time required.

Window Selection: Filter area

If a Window is selected, then the normal method and considerations for specifying a window are relevant. Help with window specification is available through the H help option in the windows submenu.

Cell size in vertical direction ? .40 Cell size in horizontal direction ?

The basic cell size is specified by the user. If a cell size of m in the vertical and n in the horizontal is specified, then pixels lying in rows i-m/2 to i+m/2 and in columns j-n/2 to j+n/2 will be used to specify the intensity of pixel ij in the resultant image.

{If Avererage if range small filter}

Average intensities if range less than what ?

This entry specifies the range the intensities must fall within in order that the low pass convolution may be applied. If the intensity range within the cell is satisfied, the pixel intensity is replaced by the average for the cell. If the range is exceeded, a smaller cell is considered using the same criterion.

{If Avererage if range large}

Average intensities if range mre than what ?

This entry specifies the range the intensities must fall outside in order that the low pass convolution may be applied. If the intensity range within the cell is satisfied, the pixel intensity is replaced by the average for the cell.


Main Menu

DigImage User Documentation


Stuart Dalziel, last page update: 19 February 1996