Fill to Contour

Fill to Contour

This facility is designed to enable regions of an image surrounded by a contour of a specific intensity level to be filled with a constant intensity specified by the user. One use for this is in the creation of a mask buffer to "mask off" unwanted regions of an image. Typically this would be achieved by locating a suitable bounding contour on some image (normally through the 'E Locate edge in window' routine with the minimum contour length set suitably high) and writing this contour to a fresh buffer. The 'Fill to contour' routine would then be invoked to allow the user to fill the entire region either inside or outside the contour will a value of, for example, 255. Once this has been achieved, the "mask" is complete. It may be used by the onboard ALU to perform AND operations so that only the part of an image lying within the region of the mask buffer with an intensity of 255 will be kept by the ALU operation.

Fill to contour in which buffer ?

Contours may be filled to using any valid DigImage buffer. If the buffer is in extended memory, then it will first be copied to buffer 0 so the user may see the fill progress. Normally the selected buffer will contain a contour previously derived by the 'C Contours' or 'E Locate edge in window' routines. However, you may Fill to contour in a raw image. Under this situation islands which do not satisfy the intensity threshold will be left unaffected. Moreover, if the fill intensity and the fill region are on the same side of the theshold (both above or both below), then any region completely bounded by the fill intensity will not be filled!

Cursor Positioning: Locate a point within the contour

The Fill to contour routine will start from this point. The point may be either inside or outside a closed contour. The intensity at this initial point will be used to determine whether the region to be filled is less than or greater than the threshold.

Threshold defining edge of region (but not included in region) ?

The fill operation will proceed from the starting point in every direction until it comes across pixels with intensity either equal to or on the otherside of the threshold value. As mentioned above, the intensity of the initial point determines whether the threshold is a lower or upper bound on the region.

Fill with what intensity ?

This field specifies the intensity with which the region is to be filled. Normally it is best to choose this intensity equal to or on the opposite side of the threshold to the initial point. If the initial point and the fill value are on the same side of the threshold, then the routine will not consider any points already at the fill value as being included in the region. This is not critical unless they completely enclose some region which does satisfy the satisfy the threshold value (in which case that region will not be filled). If this limitation causes any difficulty, the 'F Fill bounded region' option in the 'DC Cursor plotting' menu uses a different (slower) algorithm which does not have this limitation.

Confine fine fill to Window or whole Screen ?

The fill region may be confined further to a window within the buffer. Then the fill will proceed until either the contour is reached, or the edge of the window. Note that the window should include the initial point. If the initial point were to lie outside the window, then the routine returns without fillin anything.

Window Selection: Fill region within

If a bounding window is chosen, the normal DigImage window specification menu will be started. Further help on how to use this facility is available from the 'H Help' option within the window menu.

Filling to contour...


Parent menu

Main Menu

DigImage User Documentation


Stuart Dalziel, last page update: 19 February 1996