Package boofcv.alg

Class InputSanityCheck

java.lang.Object
boofcv.alg.InputSanityCheck

public class InputSanityCheck extends Object
Operations for basic sanity checks on function arguments. Checks if the contract is being obeyed by the caller.
  • 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

      public static <T extends ImageBase<T>> T declareOrReshape(T input, @Nullable T output)
      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

      public static <T extends ImageBase<T>> T declareOutput(T input, @Nullable T output)
    • declareOrReshape

      public static <T extends ImageGray<T>> T declareOrReshape(@Nullable T image, int width, int height, Class<T> imageType)
    • declareOrReshape

      public static <T extends ImageInterleaved<T>> T declareOrReshape(@Nullable T image, int width, int height, int numBands, Class<T> imageType)
    • declareOrReshape

      public static <T extends ImageGray<T>> Planar<T> declareOrReshape(@Nullable @Nullable Planar<T> image, int width, int height, int numBands, Class<T> imageType)
    • 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

      public static void checkReshape(ImageBase<?> imgA, ImageBase<?> imgB)
      Throws exception if two images are the same instance. Otherwise reshapes B to match A
    • checkReshapeB

      public static void checkReshapeB(ImageMultiBand<?> imgA, ImageMultiBand<?> imgB)
      Throws exception if two images are the same instance. Otherwise reshapes B to match A
    • checkSameShape

      public static void checkSameShape(ImageBase<?> imgA, ImageBase<?> imgB)
    • checkSameShapeB

      public static void checkSameShapeB(ImageMultiBand<?> imgA, ImageMultiBand<?> imgB)
    • checkSameShape

      public static void checkSameShape(ImagePyramid<?> imgA, ImagePyramid<?> imgB)
    • checkSameShape

      public static void checkSameShape(ImageBase<?> imgA, ImageBase<?> imgB, ImageBase<?> imgC)
    • checkSameShape

      public static void checkSameShape(ImageBase<?> imgA, ImageBase<?> imgB, ImageBase<?> imgC, ImageBase<?> imgD)
    • checkSameShape

      public static void checkSameShape(ImageBase<?> imgA, ImageBase<?> imgB, ImageBase<?> imgC, ImageBase<?> imgD, ImageBase<?> imgE)
    • reshapeOneIn

      public static void reshapeOneIn(ImageBase<?> input, ImageBase<?> outputA)
    • reshapeOneIn

      public static void reshapeOneIn(ImageBase<?> input, ImageBase<?> outputA, ImageBase<?> outputB)
    • reshapeOneIn

      public static void reshapeOneIn(ImageBase<?> input, ImageBase<?> outputA, ImageBase<?> outputB, ImageBase<?> outputC)
    • reshapeOneIn

      public static void reshapeOneIn(ImageBase<?> input, ImageBase<?> outputA, ImageBase<?> outputB, ImageBase<?> outputC, ImageBase<?> outputD)
    • checkSubimage

      public static void checkSubimage(ImageBase image)
      Makes sure the input image is not a sub-image
    • checkIndexing

      public static void checkIndexing(ImageBase imgA, ImageBase imgB)