Class MultiScaleObject
Object
MultiScaleObject
An
ObjectMask
that exists at multiple scales.
Specifically the scales are:
- the scale associated with the input-image.
- the scale associated with the segmentation (usually a scaled down version of the above).
- Author:
- Owen Feehan
-
Constructor Summary
ConstructorsConstructorDescriptionMultiScaleObject
(Supplier<ObjectMask> inputScale, Supplier<ObjectMask> modelScale) Creates with a separate supplier of anObjectMask
for each respective scale. -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> MultiScaleObject
extractFrom
(DualScale<T> dual, Function<T, ObjectMask> extractObject) static <T,
S> MultiScaleObject extractFrom
(DualScale<T> dual1, DualScale<S> dual2, BiFunction<T, S, ObjectMask> extractObject) Gets theObjectMask
at the scale associated with the input-image.Gets theObjectMask
at the scale associated with the segmentation.
-
Constructor Details
-
MultiScaleObject
Creates with a separate supplier of anObjectMask
for each respective scale.The suppliers will be cached internally, so are guaranteed to be called maximally one time.
- Parameters:
inputScale
- supplies anObjectMask
for the input-scale.modelScale
- supplies anObjectMask
for the model-scale.
-
-
Method Details
-
extractFrom
public static <T> MultiScaleObject extractFrom(DualScale<T> dual, Function<T, ObjectMask> extractObject) Creates a newMultiScaleObject
by extracting aObjectMask
from aDualScale
.This extract occurs lazily, only when needed.
- Type Parameters:
T
- the element-type of theDualScale
.- Parameters:
dual
- theDualScale
the object is extracted from.extractObject
- a function applied to the respective scale inDualScale
to extract anObjectMask
.- Returns:
- a newly created
MultiScaleObject
, as per above.
-
extractFrom
public static <T,S> MultiScaleObject extractFrom(DualScale<T> dual1, DualScale<S> dual2, BiFunction<T, S, ObjectMask> extractObject) Creates a newMultiScaleObject
by extracting aObjectMask
from twoDualScale
s.This extract occurs lazily, only when needed.
- Type Parameters:
T
- the element-type ofdual1
.S
- the element-type ofdual2
.- Parameters:
dual1
- the firstDualScale
the object is extracted from.dual2
- the secondDualScale
the object is extracted from.extractObject
- a function applied to the respective scale in the twoDualScale
s respectively to extract anObjectMask
.- Returns:
- a newly created
MultiScaleObject
, as per above.
-
getInputScale
Gets theObjectMask
at the scale associated with the input-image.- Returns:
- the object.
-
getModelScale
Gets theObjectMask
at the scale associated with the segmentation.- Returns:
- the object.
-