Class ReduceElementsGreedy
- Direct Known Subclasses:
RemoveOverlappingObjects
Reduces the number or spatial-extent of elements by favouring higher-confidence elements over
lower-confidence elements.
Elements can be removed entirely, or can have other operations executed (e.g. removing overlapping voxels).
- Select highest-confidence proposal, remove from list, add to output.
- Compare this proposal with remaining proposals, and process any overlapping elements (removing or otherwise altering).
- If there are remaining proposals in the queue, goto Step 1.
- Author:
- Owen Feehan
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract booleanprocessObjects(ObjectForReduction source, ObjectForReduction overlapping, ReduceObjectsGraph graph) Processes two objects.reduce(List<LabelledWithConfidence<ObjectMask>> elements, Extent extent, ExecutionTimeRecorder executionTimeRecorder) Reduce a list of elements (each with a confidence score and a label) to a smaller-list.protected abstract booleanshouldObjectsBeProcessed(ObjectMask source, ObjectMask other) Whether to include another (possibly-overlapping withsource) element in processing?Methods inherited from class org.anchoranalysis.bean.AnchorBean
checkMisconfigured, describeBean, describeChildren, duplicateBean, fields, findFieldsOfClass, getBeanName, getLocalPath, localise, toString
-
Constructor Details
-
ReduceElementsGreedy
public ReduceElementsGreedy()
-
-
Method Details
-
reduce
public ReductionOutcome<LabelledWithConfidence<ObjectMask>> reduce(List<LabelledWithConfidence<ObjectMask>> elements, Extent extent, ExecutionTimeRecorder executionTimeRecorder) Description copied from class:ReduceElementsReduce a list of elements (each with a confidence score and a label) to a smaller-list.It is not guaranteed that the resulting list will have fewer elements than the input list, but never more.
- Specified by:
reducein classReduceElements<ObjectMask>- Parameters:
elements- proposed bounding-boxes with scores.extent- an area in which allelementsmust exclusively reside.executionTimeRecorder- records the execution time of particular operations.- Returns:
- the outcome of the operation, indicating which elements are retained / removed / added.
-
shouldObjectsBeProcessed
Whether to include another (possibly-overlapping withsource) element in processing?- 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 abstract boolean processObjects(ObjectForReduction source, ObjectForReduction overlapping, ReduceObjectsGraph graph) Processes two objects.- 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.
-