Class SegmentedObjects

Object
SegmentedObjects

public class SegmentedObjects extends Object
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 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 in objects.
      objects - the objects with label classLabel.
      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 the reduce algorithm applied to each object-class, reusing the existing objects.
      Throws:
      OperationFailedException - if the reduction fails on any object-class.
    • highestConfidence

      public Optional<WithConfidence<MultiScaleObject>> 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

      public DualScale<SegmentedObjectsAtScale> getObjects()
      The segmented-objects, at two different scales.