Produce Contour Mask Buffer

Produce Contour Mask Buffer

This option provides a mechanism for the generation of contour mask buffers. A mask buffer is a buffer containing a binary image of intensities 0 and 255. The buffer may be used to select nonrectangular regions of an image by the use [;GMK Use mask buffer] or the logical ALU operations. As an option, the <f8> function key provides direct access to a software version of the masking operation (the use of software eliminates the need for both mask and source buffers to be onboard), using either a positive or negative version of the mask. This ability to mask off certain regions of a buffer provides a generalised windowing facility.

The contour mask is generated using the following algorithm:

           The island filter ([I Remove small islands]) is applied repeatedly
           until no more islands are found.

           Smooth contours are created for the filtered buffer.

           The regions enclosed by these smooth contours which lie above the
           required threshold are filled with an intensity of 255. Other
           regions have a zero intensity.

Produce contour mask of what buffer ?

A contour mask may be made from the contents of any buffer. Obviously the contents of the buffer should be an image which adequately describes the desired region. This source image will not normally be altered.

Place mask in what buffer ?

This entry specifies where the contour mask is to be produced. Note that buffer 0 will generally be used during the production of the contour mask. At the end of this process the contour mask buffer will be the current output buffer.

Erase current contents of mask buffer ?

Selecting yes (<Y>) will cause the current contents of the mask buffer to be erased prior to drawing the new mask on the buffer. No (<N>) allows the new mask to overlay the existing one. In this way a series of masks may be built up using different intensities (the higher intensity levels should be created first). Note that only regions of zero intensity in the initial contents of the mask buffer will be filled by the masking process, except for points falling on the contours. If you are overlaying a number of masks on a single buffer (selecting <N>), the unsmoothed contours have a lot of fine scale structure and a long smoothing length is specified, then some of the regions which should be filled may fail to be filled correctly. Selecting a smaller smoothing length and/or applying a low pass filter to the image first should normally overcome this problem (the source of which is lack of a one to one relationship between pixels in the raw and smoothed contours).

Produce mask in Window or whole Screen ?

The contour mask may be based on the image contained within a window (<W>) or the contents of the entire buffer (<S>). Note that the mask should normally be produced on the basis of a window which does not extend to the boundaries of the buffer if open contours are expected due to the smoothing of the contours (the length of open contours may be reduced by the smoothing process and so they may not extend to the boundaries of the buffer). If a window is selected the contours will initially be produced using the entire buffer; during the filling phase only the window will be used.

Window Selection: Region to be masked

If a window is chosen, then the normal DigImage window selection submenu will be produced to enable window specification. For further information about specifying windows see [H Help] within the submenu.

Threshold intensity ?

The contour masking process is controlled by a given intensity level in the source image. The threshold intensity specifies this threshold level. During the first phase small islands are removed relative to this threshold using the island filter ([I Remove small islands]). Contours are subsequently located, prior to smoothing, on pixels with an intensity greater than or equal to this threshold.

Fill intensity ?

The intensity with which the mask is filled is specified by this entry. This may be any nonzero intensity. Note that only regions of the initial mask buffer with a zero intensity falling inside the appropriate contour will be filled with this colour.

Minimum island area ?

This entry specifies the minimum area a contour may enclose. It is utilised during the island filter phase.

Smooth contours onver how many pixels ?

Once the raw contours have been located, they are smoothed by averaging over segments of the contour of a length determined by this entry. The value used will be the odd number equal to or one more than that specified.

Producing mask buffer...


Parent menu

Main Menu

DigImage User Documentation


Stuart Dalziel, last page update: 19 February 1996