Class ObjectMerger
This is designed to be used for post-processing a segmentation, to help resolve tile boundaries.
- Since:
- v0.5.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic ObjectMerger
Create an object merger that can merge together any objects with similar ROIs (e.g.static ObjectMerger
createSharedTileBoundaryMerger
(double sharedBoundaryThreshold) Create an object merger that uses a shared boundary IoU criterion and default overlap tolerance.static ObjectMerger
createSharedTileBoundaryMerger
(double sharedBoundaryThreshold, double overlapTolerance) Create an object merger that uses a shared boundary IoU criterion and overlap tolerance.static ObjectMerger
Create an object merger that can merge together any objects with similar ROIs (e.g.merge
(Collection<? extends PathObject> pathObjects) Calculate the result of applying the merging strategy to the input objects.
-
Method Details
-
merge
Calculate the result of applying the merging strategy to the input objects.The output list will contain the same number of objects or fewer. Objects that are not merged will be returned unchanged, while objects that are merged will be replaced by a new objects with a new ROI.
New objects will be assigned new IDs. Classifications will be preserved, but other measurements and properties will not be.
No guarantees are made about the mutability or ordering of the returned list.
- Parameters:
pathObjects
- the input objects for which merges should be calculated- Returns:
- a list of objects, with the same number or fewer than the input
-
createTouchingMerger
Create an object merger that can merge together any objects with similar ROIs (e.g. points, areas) that also touch one another.Objects must also have the same classification and be on the same image plane to be mergeable.
Note that this is a strict criterion following the Java Topology Suite definition of touching, which requires that the boundaries of the geometries intersect, but the interiors do not intersect.
This strictness can cause unexpected results due to floating point precision issues, unless it is certain that the ROIs are perfectly aligned (e.g they are generated using integer coordinates on a pixel grid).
If this is not the case,
createSharedTileBoundaryMerger(double, double)
is usually preferable, since it can include a small overlap tolerance.- Returns:
- an object merger that can merge together any objects with similar ROIs and the same classification
- See Also:
-