public class OverlappingObjects extends Object implements Assignment<ObjectMask>
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.
Constructor and Description |
---|
OverlappingObjects() |
Modifier and Type | Method and Description |
---|---|
void |
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.
|
List<ObjectMask> |
getLeftUnassigned()
The unassigned objects in the left set.
|
List<ObjectMask> |
getRightUnassigned()
The unassigned objects in the right set.
|
int |
leftSize()
The total number of objects in the left set.
|
int |
numberPaired()
The number of items that are paired.
|
int |
numberUnassigned(boolean left)
The number of items in a particular set that are not paired.
|
int |
numberUnassignedLeft()
The number of unassigned objects in the left set.
|
int |
numberUnassignedRight()
The number of unassigned objects in the right set.
|
List<ObjectMask> |
paired(boolean left)
The items that are paired for a particular set.
|
double |
percentLeftAssigned()
The percentage of objects in the left set that have been paired.
|
double |
percentRightAssigned()
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 |
rightSize()
The total number of objects in the right set.
|
StatisticsToExport |
statistics()
The statistics associated with the assignment.
|
double |
sumOverlapFromPaired()
Sums the overlap-ratio across all assigned pairs.
|
List<ObjectMask> |
unassigned(boolean left)
The items that are not paired for a particular set.
|
public static OverlappingObjects createWithLeftUnassigned(ObjectCollection objects)
objects
- the objects.OverlappingObjects
.public static OverlappingObjects createWithRight(ObjectCollection objects)
objects
- the objects.OverlappingObjects
.public StatisticsToExport statistics()
Assignment
statistics
in interface Assignment<ObjectMask>
public void removeTouchingBorderXY(Extent extent)
extent
- the size of the scene, which determines its borders.public List<ObjectMask> paired(boolean left)
Assignment
paired
in interface Assignment<ObjectMask>
left
- if true, the left-set is considered, otherwise the right-set.public List<ObjectMask> unassigned(boolean left)
Assignment
unassigned
in interface Assignment<ObjectMask>
left
- if true, the left-set is considered, otherwise the right-set.public double sumOverlapFromPaired()
public void addUnassignedLeft(ObjectMask object)
object
- the object to add.public void addUnassignedLeft(ObjectCollection objects)
objects
- the object to add.public void addUnassignedRight(ObjectMask object)
object
- the object to add.public void addUnassignedRight(ObjectCollection objects)
objects
- the object to add.public void addAssignedPair(ObjectMask object1, ObjectMask object2, double overlapRatio)
object1
- the left object.object2
- the right object.overlapRatio
- the ratio of overlap between the two objects.public double percentLeftAssigned()
public double percentRightAssigned()
public int numberPaired()
Assignment
This is necessarily the same number for either set.
numberPaired
in interface Assignment<ObjectMask>
public int numberUnassigned(boolean left)
Assignment
numberUnassigned
in interface Assignment<ObjectMask>
left
- if true, the left-set is considered, otherwise the right-set.public int numberUnassignedLeft()
public int numberUnassignedRight()
public int leftSize()
public int rightSize()
public List<ObjectMask> getLeftUnassigned()
public List<ObjectMask> getRightUnassigned()
Copyright © 2010–2023 Owen Feehan, ETH Zurich, University of Zurich, Hoffmann-La Roche. All rights reserved.