Class AssignOverlappingObjects
Object
AssignOverlappingObjects
Creates a one-to-one assignment between two sets of
ObjectMask
s.
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 Summary
ConstructorsConstructorDescriptionAssignOverlappingObjects
(FeatureEvaluator<FeatureInputPairObjects> featureEvaluator, boolean flatten) Creates a newAssignOverlappingObjects
instance. -
Method Summary
Modifier and TypeMethodDescriptioncreateAssignment
(ObjectCollection left, ObjectCollection right, double maxAcceptedCost, Dimensions dimensions) Creates an assignment from the objects inleft
to those inright
.getCosts()
A matrix linking the overlap between eachObjectMask
to each other, respectively as rows and columns.
-
Constructor Details
-
AssignOverlappingObjects
public AssignOverlappingObjects(FeatureEvaluator<FeatureInputPairObjects> featureEvaluator, boolean flatten) Creates a newAssignOverlappingObjects
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 inleft
to those inright
.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
A matrix linking the overlap between eachObjectMask
to each other, respectively as rows and columns.
-