Class OverlappingObjects
Object
OverlappingObjects
- All Implemented Interfaces:
Assignment<ObjectMask>
Pairs an
ObjectMask in one set with an ObjectMask in another, if deemed to
overlap sufficiently.
The sets are termed left and right as arbitrary names.
Several statistics based upon overlap, the number of pairs, the number of unassigned objects are derived.
- Author:
- Owen Feehan
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAssignedPair(ObjectMask object1, ObjectMask object2, double overlapRatio) Adds an assigned pair of objects with a particular overlap-ratio.voidaddUnassignedLeft(ObjectCollection objects) Add unassigned objects to the left set.voidaddUnassignedLeft(ObjectMask object) Add an unassigned object to the left set.voidaddUnassignedRight(ObjectCollection objects) Add unassigned objects to the right set.voidaddUnassignedRight(ObjectMask object) Add an unassigned object to the right set.static OverlappingObjectscreateWithLeftUnassigned(ObjectCollection objects) Creates with only left unassigned objects.static OverlappingObjectscreateWithRight(ObjectCollection objects) Creates with only right unassigned objects.The unassigned objects in the left set.The unassigned objects in the right set.intleftSize()The total number of objects in the left set.intThe number of items that are paired.intnumberUnassigned(boolean left) The number of items in a particular set that are not paired.intThe number of unassigned objects in the left set.intThe number of unassigned objects in the right set.paired(boolean left) The items that are paired for a particular set.doubleThe percentage of objects in the left set that have been paired.doubleThe percentage of objects in the right set that have been paired.voidremoveTouchingBorderXY(Extent extent) Removes any objects from the assignment if they touch the X or Y scene border.intThe total number of objects in the right set.The statistics associated with the assignment.doubleSums the overlap-ratio across all assigned pairs.unassigned(boolean left) The items that are not paired for a particular set.
-
Constructor Details
-
OverlappingObjects
public OverlappingObjects()
-
-
Method Details
-
createWithLeftUnassigned
Creates with only left unassigned objects.- Parameters:
objects- the objects.- Returns:
- a newly created
OverlappingObjects.
-
createWithRight
Creates with only right unassigned objects.- Parameters:
objects- the objects.- Returns:
- a newly created
OverlappingObjects.
-
statistics
Description copied from interface:AssignmentThe statistics associated with the assignment.- Specified by:
statisticsin interfaceAssignment<ObjectMask>- Returns:
- the statistics.
-
removeTouchingBorderXY
Removes any objects from the assignment if they touch the X or Y scene border.- Parameters:
extent- the size of the scene, which determines its borders.
-
paired
Description copied from interface:AssignmentThe items that are paired for a particular set.- Specified by:
pairedin interfaceAssignment<ObjectMask>- Parameters:
left- if true, the left-set is considered, otherwise the right-set.- Returns:
- a newly created list containing the paired items.
-
unassigned
Description copied from interface:AssignmentThe items that are not paired for a particular set.- Specified by:
unassignedin interfaceAssignment<ObjectMask>- Parameters:
left- if true, the left-set is considered, otherwise the right-set.- Returns:
- a newly created list containing the unpaired items for the respective set.
-
sumOverlapFromPaired
public double sumOverlapFromPaired()Sums the overlap-ratio across all assigned pairs.- Returns:
- the sum.
-
addUnassignedLeft
Add an unassigned object to the left set.- Parameters:
object- the object to add.
-
addUnassignedLeft
Add unassigned objects to the left set.- Parameters:
objects- the object to add.
-
addUnassignedRight
Add an unassigned object to the right set.- Parameters:
object- the object to add.
-
addUnassignedRight
Add unassigned objects to the right set.- Parameters:
objects- the object to add.
-
addAssignedPair
Adds an assigned pair of objects with a particular overlap-ratio.- Parameters:
object1- the left object.object2- the right object.overlapRatio- the ratio of overlap between the two objects.
-
percentLeftAssigned
public double percentLeftAssigned()The percentage of objects in the left set that have been paired.- Returns:
- the percentage.
-
percentRightAssigned
public double percentRightAssigned()The percentage of objects in the right set that have been paired.- Returns:
- the percentage.
-
numberPaired
public int numberPaired()Description copied from interface:AssignmentThe number of items that are paired.This is necessarily the same number for either set.
- Specified by:
numberPairedin interfaceAssignment<ObjectMask>- Returns:
- the total number of pairings.
-
numberUnassigned
public int numberUnassigned(boolean left) Description copied from interface:AssignmentThe number of items in a particular set that are not paired.- Specified by:
numberUnassignedin interfaceAssignment<ObjectMask>- Parameters:
left- if true, the left-set is considered, otherwise the right-set.- Returns:
- the number of unpaired items for the respective set.
-
numberUnassignedLeft
public int numberUnassignedLeft()The number of unassigned objects in the left set.- Returns:
- the number of unassigned objects.
-
numberUnassignedRight
public int numberUnassignedRight()The number of unassigned objects in the right set.- Returns:
- the number of unassigned objects.
-
leftSize
public int leftSize()The total number of objects in the left set.- Returns:
- the total number.
-
rightSize
public int rightSize()The total number of objects in the right set.- Returns:
- the total number.
-
getLeftUnassigned
The unassigned objects in the left set. -
getRightUnassigned
The unassigned objects in the right set.
-