Class SegmentedObjects
Object
SegmentedObjects
Objects that are a result of an instance-segmentation.
Each object has an associated confidence score, and an associated class-label.
Internally, objects are partitioned by class-label.
- Author:
- Owen Feehan
-
Constructor Summary
ConstructorsConstructorDescriptionSegmentedObjects
(String classLabel, Collection<WithConfidence<MultiScaleObject>> objects, SegmentedBackground background, ExecutionTimeRecorder executionTimeRecorder) Create for a collection of objects with an identical label.SegmentedObjects
(List<LabelledWithConfidence<MultiScaleObject>> objects, SegmentedBackground background, ExecutionTimeRecorder executionTimeRecorder) Create for a collection of objects with potentially differing labels. -
Method Summary
Modifier and TypeMethodDescriptionThe segmented-objects, at two different scales.The object-mask with the highest confidence.boolean
isEmpty()
Whether no segmented objects exist.reduce
(ReduceElements<ObjectMask> reduce, boolean separateEachLabel, ExecutionTimeRecorder executionTimeRecorder) Reduces the segmented-objects, applying a reduction algorithm separately to each object-class.int
size()
The total number of segmented objects.
-
Constructor Details
-
SegmentedObjects
public SegmentedObjects(String classLabel, Collection<WithConfidence<MultiScaleObject>> objects, SegmentedBackground background, ExecutionTimeRecorder executionTimeRecorder) Create for a collection of objects with an identical label.- Parameters:
classLabel
- the label that applies to each object inobjects
.objects
- the objects with labelclassLabel
.background
- background-images used for visualizing the segmentation, at two respective scales.executionTimeRecorder
- records the execution-time of particular operations.
-
SegmentedObjects
public SegmentedObjects(List<LabelledWithConfidence<MultiScaleObject>> objects, SegmentedBackground background, ExecutionTimeRecorder executionTimeRecorder) Create for a collection of objects with potentially differing labels.- Parameters:
objects
- the objects that are the result of the segmentation, with associated confidence and labels.background
- background-images used for visualizing the segmentation, at two respective scales.executionTimeRecorder
- records the execution-time of particular operations.
-
-
Method Details
-
reduce
public SegmentedObjects reduce(ReduceElements<ObjectMask> reduce, boolean separateEachLabel, ExecutionTimeRecorder executionTimeRecorder) throws OperationFailedException Reduces the segmented-objects, applying a reduction algorithm separately to each object-class.- Parameters:
reduce
- the algorithm used to reduce each object-class.separateEachLabel
- if true, each label is reduced separately. if false, all labels are reduced together.executionTimeRecorder
- records the execution-time of particular operations.- Returns:
- a new
SegmentedObjects
with thereduce
algorithm applied to each object-class, reusing the existing objects. - Throws:
OperationFailedException
- if the reduction fails on any object-class.
-
highestConfidence
The object-mask with the highest confidence.- Returns:
- the highest-confidence object-mask or
Optional.empty()
if no objects exist.
-
size
public int size()The total number of segmented objects.- Returns:
- the total number.
-
isEmpty
public boolean isEmpty()Whether no segmented objects exist.- Returns:
- true if no segmented objects exist, false otherwise.
-
getObjects
The segmented-objects, at two different scales.
-