public class ObjectMaskMerger extends Object
ObjectMask
s into a single object.Modifier and Type | Method and Description |
---|---|
static ObjectMask |
merge(ObjectCollection objects)
Merges all the objects together that are found in a collection.
|
static ObjectMask |
merge(ObjectMask first,
ObjectMask second)
Merges two objects together.
|
static BoundingBox |
mergeBoundingBoxes(ObjectCollection objects)
Merges all the bounding boxes of a collection of objects.
|
static BoundingBox |
mergeBoundingBoxes(java.util.stream.Stream<ObjectMask> objects)
Merges all the bounding boxes of a stream of objects.
|
public static ObjectMask merge(ObjectMask first, ObjectMask second)
This is an immutable operation.
The merged box has a minimal bounding-box to fit both objects.
Even if the two existing objects do not intersect or touch, a single merged object is nevertheless created.
It assumes that the binary-values of the merges are always 255 and 0, or 0 and 255.
first
- first-object to merge.second
- second-object to merge.AnchorFriendlyRuntimeException
- if incompatible binary-values exist in the objects for
merging.public static ObjectMask merge(ObjectCollection objects) throws OperationFailedException
objects
- objects to be merged.OperationFailedException
- if any two objects with different binary-values are merged.public static BoundingBox mergeBoundingBoxes(ObjectCollection objects) throws OperationFailedException
objects
- a stream of objects whose bounding-boxes are to be merged.OperationFailedException
- if the object-collection is empty.public static BoundingBox mergeBoundingBoxes(java.util.stream.Stream<ObjectMask> objects)
objects
- a stream of objects whose bounding-boxes are to be mergedCopyright © 2010–2023 Owen Feehan, ETH Zurich, University of Zurich, Hoffmann-La Roche. All rights reserved.