Class KernelMath


  • public class KernelMath
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      KernelMath()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void convert​(double[] input, int[] output, int size, double minFrac)  
      static void convert​(float[] input, int[] output, int size, float minFrac)  
      static boofcv.struct.convolve.Kernel1D_S32 convert​(boofcv.struct.convolve.Kernel1D_F32 original, float minFrac)  
      static boofcv.struct.convolve.Kernel1D_S32 convert​(boofcv.struct.convolve.Kernel1D_F64 original, double minFrac)  
      static boofcv.struct.convolve.Kernel2D_S32 convert​(boofcv.struct.convolve.Kernel2D_F32 original, float minFrac)  
      static boofcv.struct.image.GrayF32 convertToImage​(boofcv.struct.convolve.Kernel2D_F32 kernel)  
      static boofcv.struct.image.GrayS32 convertToImage​(boofcv.struct.convolve.Kernel2D_S32 kernel)  
      static boofcv.struct.convolve.Kernel2D_F32 convertToKernel​(boofcv.struct.image.GrayF32 image)  
      static boofcv.struct.convolve.Kernel2D_S32 convertToKernel​(boofcv.struct.image.GrayI image)  
      static boofcv.struct.convolve.Kernel1D convolve1D​(boofcv.struct.convolve.Kernel1D a, boofcv.struct.convolve.Kernel1D b)  
      static boofcv.struct.convolve.Kernel1D_F32 convolve1D_F32​(boofcv.struct.convolve.Kernel1D_F32 a, boofcv.struct.convolve.Kernel1D_F32 b)  
      static boofcv.struct.convolve.Kernel1D_S32 convolve1D_I32​(boofcv.struct.convolve.Kernel1D_S32 a, boofcv.struct.convolve.Kernel1D_S32 b)  
      static boofcv.struct.convolve.Kernel2D_F32 convolve2D​(boofcv.struct.convolve.Kernel1D_F32 a, boofcv.struct.convolve.Kernel1D_F32 b)
      Convolve two 1D kernels together to form a 2D kernel.
      static boofcv.struct.convolve.Kernel2D_F64 convolve2D​(boofcv.struct.convolve.Kernel1D_F64 a, boofcv.struct.convolve.Kernel1D_F64 b)
      Convolve two 1D kernels together to form a 2D kernel.
      static boofcv.struct.convolve.Kernel2D_S32 convolve2D​(boofcv.struct.convolve.Kernel1D_S32 a, boofcv.struct.convolve.Kernel1D_S32 b)
      Convolve two 1D kernels together to form a 2D kernel.
      static boofcv.struct.convolve.Kernel2D convolve2D​(boofcv.struct.convolve.Kernel1D a, boofcv.struct.convolve.Kernel1D b)
      Convolve two 1D kernels together to form a 2D kernel.
      static boofcv.struct.convolve.Kernel2D_F32 convolve2D​(boofcv.struct.convolve.Kernel2D_F32 a, boofcv.struct.convolve.Kernel2D_F32 b)  
      static boofcv.struct.convolve.Kernel2D_S32 convolve2D​(boofcv.struct.convolve.Kernel2D_S32 a, boofcv.struct.convolve.Kernel2D_S32 b)  
      static boofcv.struct.convolve.Kernel2D convolve2D​(boofcv.struct.convolve.Kernel2D a, boofcv.struct.convolve.Kernel2D b)  
      static void convolveSmooth​(boofcv.struct.convolve.Kernel1D_F32 kernel, float[] src, float[] dst, int length)
      Applies a smoothing kernel the the array.
      static void divide​(boofcv.struct.convolve.Kernel1D_F32 kernel, float value)  
      static void divide​(boofcv.struct.convolve.Kernel1D_F64 kernel, double value)  
      static void divide​(boofcv.struct.convolve.Kernel2D_F32 kernel, float value)  
      static void divide​(boofcv.struct.convolve.Kernel2D_F64 kernel, double value)  
      static void fill​(boofcv.struct.convolve.Kernel2D_F32 kernel, float value)  
      static void fill​(boofcv.struct.convolve.Kernel2D_S32 kernel, int value)  
      static boolean isEquals​(float[] expected, float[] found, int size, float tol)  
      static boolean isEquals​(int[] expected, int[] found, int size)  
      static boolean isEqualsFrac​(float[] expected, float[] found, int size, float fracTol, float zero)  
      static double maxAbs​(double[] data, int size)  
      static float maxAbs​(float[] data, int size)  
      static double minAbs​(double[] data, int size, double minValue)  
      static float minAbs​(float[] data, int size, float minValue)  
      static void normalizeAbsSumToOne​(boofcv.struct.convolve.Kernel2D_F32 kernel)
      Normalizes the array such that the absolute value sums up to one.
      static void normalizeF​(boofcv.struct.convolve.Kernel2D_F64 kernel)  
      static void normalizeMaxOne​(boofcv.struct.convolve.Kernel2D_F64 kernel)
      Normalizes it such that the largest element is equal to one
      static void normalizeSumToOne​(boofcv.struct.convolve.Kernel1D_F32 kernel)
      Normalizes the array such that it sums up to one.
      static void normalizeSumToOne​(boofcv.struct.convolve.Kernel1D_F64 kernel)  
      static void normalizeSumToOne​(boofcv.struct.convolve.Kernel2D_F32 kernel)
      Normalizes the array such that it sums up to one.
      static void normalizeSumToOne​(boofcv.struct.convolve.Kernel2D_F64 kernel)  
      static void scale​(boofcv.struct.convolve.Kernel1D_F32 kernel, float value)  
      static void scale​(boofcv.struct.convolve.Kernel1D_F64 kernel, double value)  
      static double sum​(boofcv.struct.convolve.Kernel2D_F64 kernel)  
      static boofcv.struct.convolve.Kernel2D_F32 transpose​(boofcv.struct.convolve.Kernel2D_F32 a)  
      static boofcv.struct.convolve.Kernel2D_S32 transpose​(boofcv.struct.convolve.Kernel2D_S32 a)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • KernelMath

        public KernelMath()
    • Method Detail

      • scale

        public static void scale​(boofcv.struct.convolve.Kernel1D_F32 kernel,
                                 float value)
      • scale

        public static void scale​(boofcv.struct.convolve.Kernel1D_F64 kernel,
                                 double value)
      • divide

        public static void divide​(boofcv.struct.convolve.Kernel1D_F32 kernel,
                                  float value)
      • divide

        public static void divide​(boofcv.struct.convolve.Kernel1D_F64 kernel,
                                  double value)
      • divide

        public static void divide​(boofcv.struct.convolve.Kernel2D_F32 kernel,
                                  float value)
      • divide

        public static void divide​(boofcv.struct.convolve.Kernel2D_F64 kernel,
                                  double value)
      • fill

        public static void fill​(boofcv.struct.convolve.Kernel2D_F32 kernel,
                                float value)
      • fill

        public static void fill​(boofcv.struct.convolve.Kernel2D_S32 kernel,
                                int value)
      • transpose

        public static boofcv.struct.convolve.Kernel2D_F32 transpose​(boofcv.struct.convolve.Kernel2D_F32 a)
      • transpose

        public static boofcv.struct.convolve.Kernel2D_S32 transpose​(boofcv.struct.convolve.Kernel2D_S32 a)
      • convolve1D

        public static boofcv.struct.convolve.Kernel1D convolve1D​(boofcv.struct.convolve.Kernel1D a,
                                                                 boofcv.struct.convolve.Kernel1D b)
      • convolve1D_I32

        public static boofcv.struct.convolve.Kernel1D_S32 convolve1D_I32​(boofcv.struct.convolve.Kernel1D_S32 a,
                                                                         boofcv.struct.convolve.Kernel1D_S32 b)
      • convolve1D_F32

        public static boofcv.struct.convolve.Kernel1D_F32 convolve1D_F32​(boofcv.struct.convolve.Kernel1D_F32 a,
                                                                         boofcv.struct.convolve.Kernel1D_F32 b)
      • convolveSmooth

        public static void convolveSmooth​(boofcv.struct.convolve.Kernel1D_F32 kernel,
                                          float[] src,
                                          float[] dst,
                                          int length)
        Applies a smoothing kernel the the array. The kernel must sum to 1. Array borders are handling by normalizing based on the overlap of the kernel with the image at that point
        Parameters:
        kernel - Smothing kernel that sums to 1
        src - Input array
        dst - Output array
        length - Effective length of the array
      • convolve2D

        public static boofcv.struct.convolve.Kernel2D convolve2D​(boofcv.struct.convolve.Kernel2D a,
                                                                 boofcv.struct.convolve.Kernel2D b)
      • convolve2D

        public static boofcv.struct.convolve.Kernel2D_S32 convolve2D​(boofcv.struct.convolve.Kernel2D_S32 a,
                                                                     boofcv.struct.convolve.Kernel2D_S32 b)
      • convolve2D

        public static boofcv.struct.convolve.Kernel2D_F32 convolve2D​(boofcv.struct.convolve.Kernel2D_F32 a,
                                                                     boofcv.struct.convolve.Kernel2D_F32 b)
      • convolve2D

        public static boofcv.struct.convolve.Kernel2D convolve2D​(boofcv.struct.convolve.Kernel1D a,
                                                                 boofcv.struct.convolve.Kernel1D b)
        Convolve two 1D kernels together to form a 2D kernel.
        Parameters:
        a - Input vertical 1D kernel
        b - Input horizontal 1D kernel
        Returns:
        Resulting 2D kernel
      • convolve2D

        public static boofcv.struct.convolve.Kernel2D_F32 convolve2D​(boofcv.struct.convolve.Kernel1D_F32 a,
                                                                     boofcv.struct.convolve.Kernel1D_F32 b)
        Convolve two 1D kernels together to form a 2D kernel.
        Parameters:
        a - Input vertical 1D kernel
        b - Input horizontal 1D kernel
        Returns:
        Resulting 2D kernel
      • convolve2D

        public static boofcv.struct.convolve.Kernel2D_F64 convolve2D​(boofcv.struct.convolve.Kernel1D_F64 a,
                                                                     boofcv.struct.convolve.Kernel1D_F64 b)
        Convolve two 1D kernels together to form a 2D kernel.
        Parameters:
        a - Input vertical 1D kernel
        b - Input horizontal 1D kernel
        Returns:
        Resulting 2D kernel
      • convolve2D

        public static boofcv.struct.convolve.Kernel2D_S32 convolve2D​(boofcv.struct.convolve.Kernel1D_S32 a,
                                                                     boofcv.struct.convolve.Kernel1D_S32 b)
        Convolve two 1D kernels together to form a 2D kernel.
        Parameters:
        a - Input vertical 1D kernel
        b - Input horizontal 1D kernel
        Returns:
        Resulting 2D kernel
      • normalizeSumToOne

        public static void normalizeSumToOne​(boofcv.struct.convolve.Kernel1D_F32 kernel)
        Normalizes the array such that it sums up to one.
        Parameters:
        kernel - The kernel being normalized.
      • normalizeSumToOne

        public static void normalizeSumToOne​(boofcv.struct.convolve.Kernel1D_F64 kernel)
      • normalizeSumToOne

        public static void normalizeSumToOne​(boofcv.struct.convolve.Kernel2D_F32 kernel)
        Normalizes the array such that it sums up to one.
        Parameters:
        kernel - The kernel being normalized.
      • normalizeSumToOne

        public static void normalizeSumToOne​(boofcv.struct.convolve.Kernel2D_F64 kernel)
      • normalizeAbsSumToOne

        public static void normalizeAbsSumToOne​(boofcv.struct.convolve.Kernel2D_F32 kernel)
        Normalizes the array such that the absolute value sums up to one.
        Parameters:
        kernel - The kernel being normalized.
      • sum

        public static double sum​(boofcv.struct.convolve.Kernel2D_F64 kernel)
      • normalizeF

        public static void normalizeF​(boofcv.struct.convolve.Kernel2D_F64 kernel)
      • normalizeMaxOne

        public static void normalizeMaxOne​(boofcv.struct.convolve.Kernel2D_F64 kernel)
        Normalizes it such that the largest element is equal to one
      • convertToImage

        public static boofcv.struct.image.GrayF32 convertToImage​(boofcv.struct.convolve.Kernel2D_F32 kernel)
      • convertToImage

        public static boofcv.struct.image.GrayS32 convertToImage​(boofcv.struct.convolve.Kernel2D_S32 kernel)
      • convertToKernel

        public static boofcv.struct.convolve.Kernel2D_F32 convertToKernel​(boofcv.struct.image.GrayF32 image)
      • convertToKernel

        public static boofcv.struct.convolve.Kernel2D_S32 convertToKernel​(boofcv.struct.image.GrayI image)
      • convert

        public static boofcv.struct.convolve.Kernel2D_S32 convert​(boofcv.struct.convolve.Kernel2D_F32 original,
                                                                  float minFrac)
      • convert

        public static boofcv.struct.convolve.Kernel1D_S32 convert​(boofcv.struct.convolve.Kernel1D_F32 original,
                                                                  float minFrac)
      • convert

        public static boofcv.struct.convolve.Kernel1D_S32 convert​(boofcv.struct.convolve.Kernel1D_F64 original,
                                                                  double minFrac)
      • convert

        public static void convert​(float[] input,
                                   int[] output,
                                   int size,
                                   float minFrac)
      • convert

        public static void convert​(double[] input,
                                   int[] output,
                                   int size,
                                   double minFrac)
      • maxAbs

        public static float maxAbs​(float[] data,
                                   int size)
      • maxAbs

        public static double maxAbs​(double[] data,
                                    int size)
      • minAbs

        public static float minAbs​(float[] data,
                                   int size,
                                   float minValue)
      • minAbs

        public static double minAbs​(double[] data,
                                    int size,
                                    double minValue)
      • isEqualsFrac

        public static boolean isEqualsFrac​(float[] expected,
                                           float[] found,
                                           int size,
                                           float fracTol,
                                           float zero)
      • isEquals

        public static boolean isEquals​(float[] expected,
                                       float[] found,
                                       int size,
                                       float tol)
      • isEquals

        public static boolean isEquals​(int[] expected,
                                       int[] found,
                                       int size)