Selecting and Sorting Blobs¶
During image encoding, any segmented pixels are treated as part of an object. This can lead to detecting tiny objects that are actually clusters of noisy pixels. Filtering or sorting the blobs can help you select only the object of interest.
You can select which blobs to keep using the class EObjectSelection .NET Python.
Create a Selection¶
To create a selection, you must perform a combination of add and remove operations based on various criteria:
Add all the objects from all the layers of a coded image with
AddObjects.NET Python.Add or remove all the objects from a layer of a coded image with
AddLayer.NET Python andRemoveLayer.NET Python.Add or remove a single object based on its position with
AddObjectUsingPosition.NET Python andRemoveObjectUsingPosition.NET Python.Add or remove objects or holes whose location fullfil a criterion based on an arbitrary region or a rectangle:
For arbitrary region, use
AddObjectsUsingRegion.NET Python andRemoveObjectUsingPosition.NET Python.For a rectangle, use
AddObjectsUsingRectangle.NET Python andRemoveObjectsUsingRectangle.NET Python.The selection criterion is defined by
ERectangleMode.NET Python.
Examples of objects matching the criterion
EntirelyInside.NET Python,EntirelyOutside.NET Python, andOnBorder.NET Python.¶Add or remove objects or holes that fullfil a condition based on numerical features. The method depends on the type of the feature:
For floating point features, use
AddObjectsUsingFloatFeature.NET Python andRemoveUsingFloatFeature.NET Python.For unsigned integer features, use
AddObjectsUsingUnsignedIntegerFeature.NET Python andRemoveUsingUnsignedIntegerFeature.NET Python.For integer features, use
AddObjectsUsingIntegerFeature.NET Python andRemoveUsingIntegerFeature.NET Python.
Add or remove a single hole with
AddHole.NET Python andRemoveHole.NET Python.Add or remove all the holes from an object, layer, or coded image with
AddHoles.NET Python andRemoveHoles.NET Python.Add all the holes of all the object currently in the selection with
AddHolesOfSelectedObjects.NET Python.Remove all the holes that are currently in the selection with
RemoveSelectedHoles.NET Python.
Clear a Selection¶
You can clear a previous selection using EObjectSelection::Clear .NET Python.
Sort a Selection¶
You can sort the elements of a selection according to any of their features using EObjectSelection::Sort .NET Python.
See also
See the code snippets showing how to select and sort blobs.