EasyObject - Analyzing Blobs
The EasyObject library picks out features in an image by creating and processing blobs (objects or holes that have the same gray level range).
This library can be used for BW1, BW8, BW16 and C24 source images and is accessible from the ECodedImage2 class which has improved execution time, especially for large images with many objects.
A blob is a grouping of neighboring pixels of the same gray level range.
Blobs may be objects or holes in objects. EasyObject functions analyze both objects and holes.
When blobs are built, the inclusion relationship between holes and objects is computed.
Even though holes may be the actual objects of interest, it is easier to find an object of interest, then detect its holes (with EasyObject) and measure their characteristics (with EasyGauge or EasyObject).
Blobs are handled as independent entities:
- They can be selected by means of the layer they belong to, their position, a rectangular ROI or their computed features. The selection criteria can be combined (select the small objects; among these, select those close to the right edge...).
- They can be listed and sorted by their geometric characteristics: such as area, width, or ellipse of inertia.
Blob analysis can be restricted to rectangular and nested ROIs, and to complex or disconnected-shape regions using flexible masks.
EasyObject chooses objects of interest and constructs blobs/holes in two steps:
- Segment: classifies the source image pixels, creates layers, and constructs the runs (a run is a sequence of adjacent pixels in a row, that share the same property).
- Encode: assembles runs, to build blobs for each layer.
You select which objects or holes are kept.
EImageEncoder::Encode analyzes the blobs and stores the result into a coded image which has a set of superimposed, mutually exclusive image layers, where the pixels of each layer have properties in common, such as being above a threshold.
Flexible masks can restrict encoding to an arbitrary shaped area.
There is no need to build holes, they are constructed on-the-fly when required.
- Segmentation GetSegmentationMethod and SetSegmentationMethod
- Grayscale single threshold EGrayscaleSingleThresholdSegmenter
- Grayscale double threshold EGrayscaleDoubleThresholdSegmenter
- Color single threshold EColorSingleThresholdSegmenter
- Color range threshold EColorRangeThresholdSegmenter
- Reference image EReferenceImageSegmenter
- Image range EImageRangeSegmenter
- Labeled image ELabeledImageSegmenter
- Binary images EBinaryImageSegmenter
Pixel aggregation (encoder)
- Layer selection
- Object construction: run aggregation into objects
- Hole construction: run aggregation into holes
Once an image has been encoded, the coded elements (objects or holes) are accessible through the abstract class ECodedElement which provides a large set of methods applicable to a particular coded element:
Features computation and display
The objects, holes and their features can be efficiently accessed randomly (in an index-based fashion).