Package boofcv.alg
Class InputSanityCheck
java.lang.Object
boofcv.alg.InputSanityCheck
Operations for basic sanity checks on function arguments. Checks if the contract is being obeyed by the caller.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
checkIndexing
(ImageBase imgA, ImageBase imgB) static void
checkReshape
(ImageBase<?> imgA, ImageBase<?> imgB) Throws exception if two images are the same instance.static <T extends ImageGray<T>>
TcheckReshape
(T target, ImageGray testImage, Class<T> targetType) Checks to see if the target image is null or if it is a different size than the test image.static void
checkReshapeB
(ImageMultiBand<?> imgA, ImageMultiBand<?> imgB) Throws exception if two images are the same instance.static void
checkSameShape
(ImageBase<?> imgA, ImageBase<?> imgB) static void
checkSameShape
(ImageBase<?> imgA, ImageBase<?> imgB, ImageBase<?> imgC) static void
checkSameShape
(ImageBase<?> imgA, ImageBase<?> imgB, ImageBase<?> imgC, ImageBase<?> imgD) static void
checkSameShape
(ImageBase<?> imgA, ImageBase<?> imgB, ImageBase<?> imgC, ImageBase<?> imgD, ImageBase<?> imgE) static void
checkSameShape
(ImagePyramid<?> imgA, ImagePyramid<?> imgB) static void
checkSameShapeB
(ImageMultiBand<?> imgA, ImageMultiBand<?> imgB) static void
checkSubimage
(ImageBase image) Makes sure the input image is not a sub-imagedeclareOrReshape
(@Nullable Planar<T> image, int width, int height, int numBands, Class<T> imageType) declareOrReshape
(In input, Out output, Class<Out> typeOut) If the output has not been declared a new instance is declared.static <T extends ImageInterleaved<T>>
TdeclareOrReshape
(T image, int width, int height, int numBands, Class<T> imageType) static <T extends ImageGray<T>>
TdeclareOrReshape
(T image, int width, int height, Class<T> imageType) static <T extends ImageBase<T>>
TdeclareOrReshape
(T input, T output) If the output has not been declared a new instance is declared.static <T extends ImageBase<T>>
TdeclareOutput
(T input, T output) static void
reshapeOneIn
(ImageBase<?> input, ImageBase<?> outputA) static void
reshapeOneIn
(ImageBase<?> input, ImageBase<?> outputA, ImageBase<?> outputB) static void
reshapeOneIn
(ImageBase<?> input, ImageBase<?> outputA, ImageBase<?> outputB, ImageBase<?> outputC) static void
reshapeOneIn
(ImageBase<?> input, ImageBase<?> outputA, ImageBase<?> outputB, ImageBase<?> outputC, ImageBase<?> outputD)
-
Constructor Details
-
InputSanityCheck
public InputSanityCheck()
-
-
Method Details
-
checkReshape
public static <T extends ImageGray<T>> T checkReshape(T target, ImageGray testImage, Class<T> targetType) Checks to see if the target image is null or if it is a different size than the test image. If it is null then a new image is returned, otherwise target is reshaped and returned. -
declareOrReshape
If the output has not been declared a new instance is declared. If output is not null then it will be reshaped to match the input. -
declareOutput
-
declareOrReshape
-
declareOrReshape
public static <T extends ImageInterleaved<T>> T declareOrReshape(@Nullable T image, int width, int height, int numBands, Class<T> imageType) -
declareOrReshape
-
declareOrReshape
public static <In extends ImageGray,Out extends ImageGray> Out declareOrReshape(In input, @Nullable Out output, Class<Out> typeOut) If the output has not been declared a new instance is declared. If an instance of the output is provided its bounds are checked. -
checkReshape
Throws exception if two images are the same instance. Otherwise reshapes B to match A -
checkReshapeB
Throws exception if two images are the same instance. Otherwise reshapes B to match A -
checkSameShape
-
checkSameShapeB
-
checkSameShape
-
checkSameShape
-
checkSameShape
-
checkSameShape
-
reshapeOneIn
-
reshapeOneIn
-
reshapeOneIn
-
reshapeOneIn
-
checkSubimage
Makes sure the input image is not a sub-image -
checkIndexing
-