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 TypeMethodDescriptionvoid
addAssignedPair
(ObjectMask object1, ObjectMask object2, double overlapRatio) Adds an assigned pair of objects with a particular overlap-ratio.void
addUnassignedLeft
(ObjectCollection objects) Add unassigned objects to the left set.void
addUnassignedLeft
(ObjectMask object) Add an unassigned object to the left set.void
addUnassignedRight
(ObjectCollection objects) Add unassigned objects to the right set.void
addUnassignedRight
(ObjectMask object) Add an unassigned object to the right set.static OverlappingObjects
createWithLeftUnassigned
(ObjectCollection objects) Creates with only left unassigned objects.static OverlappingObjects
createWithRight
(ObjectCollection objects) Creates with only right unassigned objects.The unassigned objects in the left set.The unassigned objects in the right set.int
leftSize()
The total number of objects in the left set.int
The number of items that are paired.int
numberUnassigned
(boolean left) The number of items in a particular set that are not paired.int
The number of unassigned objects in the left set.int
The number of unassigned objects in the right set.paired
(boolean left) The items that are paired for a particular set.double
The percentage of objects in the left set that have been paired.double
The percentage of objects in the right set that have been paired.void
removeTouchingBorderXY
(Extent extent) Removes any objects from the assignment if they touch the X or Y scene border.int
The total number of objects in the right set.The statistics associated with the assignment.double
Sums 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:Assignment
The statistics associated with the assignment.- Specified by:
statistics
in 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:Assignment
The items that are paired for a particular set.- Specified by:
paired
in 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:Assignment
The items that are not paired for a particular set.- Specified by:
unassigned
in 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:Assignment
The number of items that are paired.This is necessarily the same number for either set.
- Specified by:
numberPaired
in interfaceAssignment<ObjectMask>
- Returns:
- the total number of pairings.
-
numberUnassigned
public int numberUnassigned(boolean left) Description copied from interface:Assignment
The number of items in a particular set that are not paired.- Specified by:
numberUnassigned
in 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.
-