Class RemoveOverlappingObjects
Intersecting objects are removed if they have sufficient overlap.
This involves non-maximum suppression for object-masks using an Intersection over Union score.
A strategy for reducing elements that greedily removes any element with a strong overlap with another.
The highest-confidence element is always retained as a priority over lower-confidence elements.
The strength of the overlap is measured by a score with 0 <= score <= 1).
See Non-maximum suppression for a description of the algorithm.
- Author:
- Owen Feehan
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoubleBounding boxes with scores above this threshold are removed.protected booleanprocessObjects(ObjectForReduction source, ObjectForReduction overlapping, ReduceObjectsGraph graph) Processes two objects.voidsetScoreThreshold(double scoreThreshold) Bounding boxes with scores above this threshold are removed.protected booleanshouldObjectsBeProcessed(ObjectMask source, ObjectMask other) Whether to include another (possibly-overlapping withsource) element in processing?Methods inherited from class org.anchoranalysis.image.inference.bean.reduce.ReduceElementsGreedy
reduceMethods inherited from class org.anchoranalysis.bean.AnchorBean
checkMisconfigured, describeBean, describeChildren, duplicateBean, fields, findFieldsOfClass, getBeanName, getLocalPath, localise, toString
-
Constructor Details
-
RemoveOverlappingObjects
public RemoveOverlappingObjects()
-
-
Method Details
-
shouldObjectsBeProcessed
Description copied from class:ReduceElementsGreedyWhether to include another (possibly-overlapping withsource) element in processing?- Specified by:
shouldObjectsBeProcessedin classReduceElementsGreedy- Parameters:
source- the element we are currently processing, for which we search for possibly overlapping elementother- another object which we are considering to include in processing (in conjunction withsource).- Returns:
- true iff
othershould be included in processing.
-
processObjects
protected boolean processObjects(ObjectForReduction source, ObjectForReduction overlapping, ReduceObjectsGraph graph) Description copied from class:ReduceElementsGreedyProcesses two objects.- Specified by:
processObjectsin classReduceElementsGreedy- Parameters:
source- the element that is being processed as the source, the object with higher confidence.overlapping- the element that is deemed to overlap with thesourceElementabout which a decision is to be made.graph- the graph relating objects to each other, and determining the priority for reduction.- Returns:
- true if the
sourceobject was altered during processing, false if it was not.
-
getScoreThreshold
public double getScoreThreshold()Bounding boxes with scores above this threshold are removed. -
setScoreThreshold
public void setScoreThreshold(double scoreThreshold) Bounding boxes with scores above this threshold are removed.
-