Collapse
The Collapse module is a morphological module that can be used to analyze an object's shape. The module
will collapse a binary image by shifting the non-black pixels to the side of the image specified
in the user interface. The resulting image is appears like a histogram but instead of representing the
number of colors within an image (a histogram) it relates to how many non-black pixels are in
each vertical or horizontal scan line (when in Binary mode). Basically each scan line (either horizontal or vertical)
is scanned for non-black pixels. If one if found the resulting height if incremented by 1. This
continues for all scan lines.
Note that left & right and top & bottom are symmetrical
views of the same information.
This module is useful in shape analysis where decomposing the shape of an image reduces the shape detection
problem to a 1 dimensional problem rather than a 2 dimensional problem. While the reduction in dimension
does come at a shape uniqueness price it can be a sufficient model in many cases.
This module is often combined with the peak detection module to determine if a shape is present.
Interface
Instructions
1. Direction - Specify which direction you want the current pixels to collapse/shift towards
2. Method - If you have black and white pixels you can use Binary mode to create the histogram. If instead
you have grayscale or colored pixels that represent the intensity value of the pixel then selecting analog mode will
sum up all those pixels and create a white pixel to represent values greater than 255.
Example
| Source | Left Collapsed |
 |  |
| Bottom Collapsed | Right Collapsed |
 |  |
| Source | Bottom Analog Collapsed |
 |  |
See Also
Threshold
|