Northern Eclipse Help Reference

 Binary Operations


Binary Operations are a group of functions that work together in order to process images at a binary level.  They work on monochrome images only.  Each pixel in the input image is assigned a value of black (off) or white (on) and the output is an image that consists of only black or white pixels. 

 

The operators can be grouped into three categories according to their use:

Category 1: Region shaping operators

Erode – This operator takes the outermost layer of pixels off of all objects in the scene.  If the object is below a critical size, it is eliminated.

Dilate – This operator adds a new layer of pixels to the outermost layer of all objects in the scene.  It may cause objects to join.

Open – This operator performs a series of erosions followed by an equal amount of dilations as specified by the depth parameter.

Close – This operator performs a series of dilations followed by an equal amount of erosions as specified by the depth parameter.

These functions are usually used to clean up an image before it is measured.  Here are some typical tasks that these operators are used for:

1) Fix breaks in an edge / Join objects:  Binary Close (depth corresponding to break size)
2) Widen breaks in an edge / Separate Objects: Binary Open (depth corresponding to break size)
3) Fill Small Holes: Binary Close (depth corresponding to radius of hole)
4) Remove Small objects: Binary Open (depth corresponding to radius of object)
5) Smoothen Perimeter: Binary Open or Binary Close (depth of 1)
6) Grow an Object boundary: Dilate
7) Shrink an Object boundary: Erode

Each of these operators can be applied in one particular orientation or performed in all directions according to the direction parameter.

Category 2: skeleton operators

Skeletonize – This operator is used to remove the outer layer of pixels from all objects. It is similar to erosion except that instead of completely removing an object it will stop when it has reached the center line of the object.  This operator can be run iteratively or until it can no longer remove pixels from the image.

Prune – This operator starts with a skeletonized image and trims one pixel from the end of each skeleton branch.  This operator can be run iteratively or until it can no longer remove pixels from the image.

Break Nodes – This operator starts with a skeletonized image and removes all nodes (where three or more branches meet).  This operator only needs to be done once.

Distance Map – This function creates a new image from the current binary image where the intensity for a pixel represents its distance to a background pixel.

These functions can be used for many reasons.

1) Count branches in an object: By skeletonizing (exhaustive) followed by Break Nodes, you are left with a picture of lines representing the branches of an object.  This makes it very easy to get an estimate of the length of all the branches (even if they cross).
2) Isolate Nodes: By skeletonizing, duplicating, Breaking the nodes on the duplicate and performing a Boolean difference, you are left with a picture of the nodes of a branching object.
3) Zone Of Influence: By using Boolean Reverse, Skeletonizing (exhaustive), Pruning (exhaustive), Boolean Reversal again, and Boolean MIN with the original image, you get an image that has been cut by its zone of influence.  You can separate objects if you perform a series of dilations after the first reverse to connect the broken lines that cross the object.  If that fills in the zones then perform the dilation after the first skeletonize and then re-skeltonize.  Note that when you measure objects separated only by a single pixel wide line, you need to either dilate the zone of influence or make sure that the 4-way boundary rule is used during measure.
4) Shape Analysis and Matching: By using Skeletonize (exhaustive) on an image you get an image that conveys all the shape and orientation of the original image but with much less information density.  You can use the node count and branch count and lengths to classify objects first before a search.  This is a much more robust object matching routine and takes up much less space than the equivalent image.

Category 3: Rank Filtering operators

These operators differ than the ones above since they operate on grayscale images as well as strictly binary images.

Minimum Filter – This operator takes the 9 pixel values in the neighborhood immediately surrounding the current pixel, ranks them in order and replaces the current pixel with the minimum value that it finds.  This will completely get rid of single pixel “white spots” while tending to slightly shrink the boundary of an object.

Median Filter – This operator takes the 9 pixel values in the neighborhood immediately surrounding the current pixel, ranks them in order and replaces the current pixel with the middle value that it finds.  This will completely get rid of single pixel “white spots” or “black spots” while leaving the boundary of an object relatively the same size.

Maximum Filter – This operator takes the 9 pixel values in the neighborhood immediately surrounding the current pixel, ranks them in order and replaces the current pixel with the maximum value that it finds. This will completely get rid of single pixel “black spots” while tending to slightly expand the boundary of an object.

These functions are typically used to perform noise reducing.  Specifically it is extremely good at reducing salt and pepper noise.  This is the noise caused by individual dead or stuck pixels in a digital image.  It is much better than a convolution filter that would just spread part of the noise around to neighboring pixels.  It also does not smooth the image nearly as much as a convolution filter.


See Also

Boolean Operations, Convolution Filters

References

Table of Contents
Function Reference
Menu Reference
Toolbar Reference