Class AssignOverlappingObjects

Object
AssignOverlappingObjects

public class AssignOverlappingObjects extends Object
Creates a one-to-one assignment between two sets of ObjectMasks.

As arbitrary naming, these sets are termed left and right.

An assignment is one-to-one mapping between the first set and the second, borrowing terminology from the assignment problem.

Not all objects must be mapped. An object may only be mapped to maximally one object in the other set.

The Hungarian Algorithm is used to determine the assignment, based upon an overlap function between the corresponding objects. The assignments are chosen to maximize total overlap.

Author:
Owen Feehan
  • Constructor Details

    • AssignOverlappingObjects

      public AssignOverlappingObjects(FeatureEvaluator<FeatureInputPairObjects> featureEvaluator, boolean flatten)
      Creates a new AssignOverlappingObjects instance.
      Parameters:
      featureEvaluator - A feature that gives a measure of cost between a pair of objects, which should be maximally 1.0 (for no overlap) and 0.0 (for perfect overlap).
      flatten - If true, a maximum-intensity-projection is first applied to any 3D objects into a 2D plane, before comparison.
  • Method Details

    • createAssignment

      public OverlappingObjects createAssignment(ObjectCollection left, ObjectCollection right, double maxAcceptedCost, Dimensions dimensions) throws FeatureCalculationException
      Creates an assignment from the objects in left to those in right.

      See the class documentation for the algorithm involved.

      Parameters:
      left - the left objects.
      right - the right objects.
      maxAcceptedCost - an upper-maximum cost, above which a mapping will be disallowed between objects.
      dimensions - the dimensions of the scene in which all objects reside.
      Returns:
      a newly created assignment.
      Throws:
      FeatureCalculationException - if overlap cannot be calculated.
    • getCosts

      public CostMatrix<ObjectMask> getCosts()
      A matrix linking the overlap between each ObjectMask to each other, respectively as rows and columns.