Class UtilWavelet


  • public class UtilWavelet
    extends java.lang.Object
    Various functions which are useful when working with or computing wavelet transforms.
    • Constructor Summary

      Constructors 
      Constructor Description
      UtilWavelet()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void adjustForDisplay​(boofcv.struct.image.ImageGray transform, int numLevels, double valueRange)
      Adjusts the values inside a wavelet transform to make it easier to view.
      static int borderForwardLower​(boofcv.struct.wavelet.WlCoef desc)
      Returns the lower border for a forward wavelet transform.
      static int borderForwardUpper​(boofcv.struct.wavelet.WlCoef desc, int dataLength)
      Returns the upper border (offset from image edge) for a forward wavelet transform.
      static int borderInverseLower​(boofcv.struct.wavelet.WlBorderCoef<?> desc, boofcv.struct.border.BorderIndex1D border)
      Returns the lower border for an inverse wavelet transform.
      static int borderInverseUpper​(boofcv.struct.wavelet.WlBorderCoef<?> desc, boofcv.struct.border.BorderIndex1D border, int dataLength)
      Returns the upper border (offset from image edge) for an inverse wavelet transform.
      static int checkInverseLower​(boofcv.struct.wavelet.WlCoef coef, int index, boofcv.struct.border.BorderIndex1D border, int current)  
      static int checkInverseUpper​(boofcv.struct.wavelet.WlCoef coef, int index, boofcv.struct.border.BorderIndex1D border, int current)  
      static void checkShape​(boofcv.struct.image.ImageGray original, boofcv.struct.image.ImageGray transformed)
      The original image can have an even or odd number of width/height.
      static void checkShape​(boofcv.struct.wavelet.WlCoef desc, boofcv.struct.image.ImageGray original, boofcv.struct.image.ImageGray transformed, int level)  
      static int computeDiv​(int level)
      Returns the number that the output image needs to be divisible by.
      static double computeEnergy​(float[] array)
      Compute the energy of the specified array.
      static double computeEnergy​(int[] array, int denominator)
      Compute the energy of the specified array.
      static int computeScale​(int level)  
      static boofcv.struct.border.BorderType convertToType​(boofcv.struct.border.BorderIndex1D b)  
      static int round​(int top, int div2, int divisor)
      Specialized rounding for use with integer wavelet transform.
      static double sumCoefficients​(float[] array)  
      static int sumCoefficients​(int[] array)  
      static boofcv.struct.image.ImageDimension transformDimension​(int width, int height, int level)  
      static boofcv.struct.image.ImageDimension transformDimension​(boofcv.struct.image.ImageBase orig, int level)
      Returns dimension which is required for the transformed image in a multilevel wavelet transform.
      • Methods inherited from class java.lang.Object

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

      • UtilWavelet

        public UtilWavelet()
    • Method Detail

      • checkShape

        public static void checkShape​(boofcv.struct.image.ImageGray original,
                                      boofcv.struct.image.ImageGray transformed)
        The original image can have an even or odd number of width/height. While the transformed image must have an even number of pixels. If the original image is even then the sames are the same, otherwise the transformed image's shape is rounded up.
        Parameters:
        original - Original input image.
        transformed - Image which has been transformed.
      • checkShape

        public static void checkShape​(boofcv.struct.wavelet.WlCoef desc,
                                      boofcv.struct.image.ImageGray original,
                                      boofcv.struct.image.ImageGray transformed,
                                      int level)
      • computeScale

        public static int computeScale​(int level)
      • computeDiv

        public static int computeDiv​(int level)
        Returns the number that the output image needs to be divisible by.
      • transformDimension

        public static boofcv.struct.image.ImageDimension transformDimension​(boofcv.struct.image.ImageBase orig,
                                                                            int level)
        Returns dimension which is required for the transformed image in a multilevel wavelet transform.
      • transformDimension

        public static boofcv.struct.image.ImageDimension transformDimension​(int width,
                                                                            int height,
                                                                            int level)
      • computeEnergy

        public static double computeEnergy​(float[] array)

        Compute the energy of the specified array.

        E = sum( i=1..N , a[i]*a[i] )

      • computeEnergy

        public static double computeEnergy​(int[] array,
                                           int denominator)

        Compute the energy of the specified array.

        E = sum( i=1..N , a[i]*a[i] ) / (N*d*d)

      • sumCoefficients

        public static double sumCoefficients​(float[] array)
      • sumCoefficients

        public static int sumCoefficients​(int[] array)
      • borderForwardLower

        public static int borderForwardLower​(boofcv.struct.wavelet.WlCoef desc)
        Returns the lower border for a forward wavelet transform.
      • borderForwardUpper

        public static int borderForwardUpper​(boofcv.struct.wavelet.WlCoef desc,
                                             int dataLength)
        Returns the upper border (offset from image edge) for a forward wavelet transform.
      • borderInverseLower

        public static int borderInverseLower​(boofcv.struct.wavelet.WlBorderCoef<?> desc,
                                             boofcv.struct.border.BorderIndex1D border)
        Returns the lower border for an inverse wavelet transform.
      • checkInverseLower

        public static int checkInverseLower​(boofcv.struct.wavelet.WlCoef coef,
                                            int index,
                                            boofcv.struct.border.BorderIndex1D border,
                                            int current)
      • borderInverseUpper

        public static int borderInverseUpper​(boofcv.struct.wavelet.WlBorderCoef<?> desc,
                                             boofcv.struct.border.BorderIndex1D border,
                                             int dataLength)
        Returns the upper border (offset from image edge) for an inverse wavelet transform.
      • checkInverseUpper

        public static int checkInverseUpper​(boofcv.struct.wavelet.WlCoef coef,
                                            int index,
                                            boofcv.struct.border.BorderIndex1D border,
                                            int current)
      • round

        public static int round​(int top,
                                int div2,
                                int divisor)
        Specialized rounding for use with integer wavelet transform. return (top +- div2) / divisor;
        Parameters:
        top - Top part of the equation.
        div2 - The divisor divided by two.
        divisor - The divisor.
        Returns:
      • convertToType

        public static boofcv.struct.border.BorderType convertToType​(boofcv.struct.border.BorderIndex1D b)
      • adjustForDisplay

        public static void adjustForDisplay​(boofcv.struct.image.ImageGray transform,
                                            int numLevels,
                                            double valueRange)
        Adjusts the values inside a wavelet transform to make it easier to view.
        Parameters:
        transform -
        numLevels - Number of levels in the transform