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 anObjectMaskfor each respective scale. -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> MultiScaleObjectextractFrom(DualScale<T> dual, Function<T, ObjectMask> extractObject) static <T,S> MultiScaleObject extractFrom(DualScale<T> dual1, DualScale<S> dual2, BiFunction<T, S, ObjectMask> extractObject) Gets theObjectMaskat the scale associated with the input-image.Gets theObjectMaskat the scale associated with the segmentation.
-
Constructor Details
-
MultiScaleObject
Creates with a separate supplier of anObjectMaskfor each respective scale.The suppliers will be cached internally, so are guaranteed to be called maximally one time.
- Parameters:
inputScale- supplies anObjectMaskfor the input-scale.modelScale- supplies anObjectMaskfor the model-scale.
-
-
Method Details
-
extractFrom
public static <T> MultiScaleObject extractFrom(DualScale<T> dual, Function<T, ObjectMask> extractObject) Creates a newMultiScaleObjectby extracting aObjectMaskfrom aDualScale.This extract occurs lazily, only when needed.
- Type Parameters:
T- the element-type of theDualScale.- Parameters:
dual- theDualScalethe object is extracted from.extractObject- a function applied to the respective scale inDualScaleto 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 newMultiScaleObjectby extracting aObjectMaskfrom twoDualScales.This extract occurs lazily, only when needed.
- Type Parameters:
T- the element-type ofdual1.S- the element-type ofdual2.- Parameters:
dual1- the firstDualScalethe object is extracted from.dual2- the secondDualScalethe object is extracted from.extractObject- a function applied to the respective scale in the twoDualScales respectively to extract anObjectMask.- Returns:
- a newly created
MultiScaleObject, as per above.
-
getInputScale
Gets theObjectMaskat the scale associated with the input-image.- Returns:
- the object.
-
getModelScale
Gets theObjectMaskat the scale associated with the segmentation.- Returns:
- the object.
-