Class DiscreteFourierTransformOps


  • public class DiscreteFourierTransformOps
    extends java.lang.Object
    Various functions related to DiscreteFourierTransform.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void checkImageArguments​(boofcv.struct.image.ImageBase image, boofcv.struct.image.ImageInterleaved transform)
      Checks to see if the image and its transform are appropriate sizes .
      static DiscreteFourierTransform<boofcv.struct.image.GrayF32,​boofcv.struct.image.InterleavedF32> createTransformF32()
      Creates a DiscreteFourierTransform for images of type GrayF32.
      static DiscreteFourierTransform<boofcv.struct.image.GrayF64,​boofcv.struct.image.InterleavedF64> createTransformF64()
      Creates a DiscreteFourierTransform for images of type GrayF64.
      static boolean isPowerOf2​(int x)
      true if the number provided is a power of two
      static void magnitude​(boofcv.struct.image.InterleavedF32 transform, boofcv.struct.image.GrayF32 magnitude)
      Computes the magnitude of the complex image:
      magnitude = sqrt( real2 + imaginary2 )
      static void magnitude​(boofcv.struct.image.InterleavedF64 transform, boofcv.struct.image.GrayF64 magnitude)
      Computes the magnitude of the complex image:
      magnitude = sqrt( real2 + imaginary2 )
      static void multiplyComplex​(boofcv.struct.image.InterleavedF32 complexA, boofcv.struct.image.InterleavedF32 complexB, boofcv.struct.image.InterleavedF32 complexC)
      Performs element-wise complex multiplication between two complex images.
      static void multiplyComplex​(boofcv.struct.image.InterleavedF64 complexA, boofcv.struct.image.InterleavedF64 complexB, boofcv.struct.image.InterleavedF64 complexC)
      Performs element-wise complex multiplication between two complex images.
      static void multiplyRealComplex​(boofcv.struct.image.GrayF32 realA, boofcv.struct.image.InterleavedF32 complexB, boofcv.struct.image.InterleavedF32 complexC)
      Performs element-wise complex multiplication between a real image and a complex image.
      static void multiplyRealComplex​(boofcv.struct.image.GrayF64 realA, boofcv.struct.image.InterleavedF64 complexB, boofcv.struct.image.InterleavedF64 complexC)
      Performs element-wise complex multiplication between a real image and a complex image.
      static int nextPow2​(int x)
      Returns the closest power-of-two number greater than or equal to x.
      static void phase​(boofcv.struct.image.InterleavedF32 transform, boofcv.struct.image.GrayF32 phase)
      Computes the phase of the complex image:
      phase = atan2( imaginary , real )
      static void phase​(boofcv.struct.image.InterleavedF64 transform, boofcv.struct.image.GrayF64 phase)
      Computes the phase of the complex image:
      phase = atan2( imaginary , real )
      static void realToComplex​(boofcv.struct.image.GrayF32 real, boofcv.struct.image.InterleavedF32 complex)
      Converts a regular image into a complex interleaved image with the imaginary component set to zero.
      static void realToComplex​(boofcv.struct.image.GrayF64 real, boofcv.struct.image.InterleavedF64 complex)
      Converts a regular image into a complex interleaved image with the imaginary component set to zero.
      static void shiftZeroFrequency​(boofcv.struct.image.InterleavedF32 transform, boolean forward)
      Moves the zero-frequency component into the image center (width/2,height/2).
      static void shiftZeroFrequency​(boofcv.struct.image.InterleavedF64 transform, boolean forward)
      Moves the zero-frequency component into the image center (width/2,height/2).
      • Methods inherited from class java.lang.Object

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

      • DiscreteFourierTransformOps

        public DiscreteFourierTransformOps()
    • Method Detail

      • isPowerOf2

        public static boolean isPowerOf2​(int x)
        true if the number provided is a power of two
        Parameters:
        x - number
        Returns:
        true if it is a power of two
      • nextPow2

        public static int nextPow2​(int x)
        Returns the closest power-of-two number greater than or equal to x.
        Parameters:
        x -
        Returns:
        the closest power-of-two number greater than or equal to x
      • checkImageArguments

        public static void checkImageArguments​(boofcv.struct.image.ImageBase image,
                                               boofcv.struct.image.ImageInterleaved transform)
        Checks to see if the image and its transform are appropriate sizes . The transform should have twice the width and twice the height as the image.
        Parameters:
        image - Storage for an image
        transform - Storage for a Fourier Transform
      • shiftZeroFrequency

        public static void shiftZeroFrequency​(boofcv.struct.image.InterleavedF32 transform,
                                              boolean forward)
        Moves the zero-frequency component into the image center (width/2,height/2). This function can be called to undo the transform.
        Parameters:
        transform - the DFT which is to be shifted.
        forward - If true then it does the shift in the forward direction. If false then it undoes the transforms.
      • shiftZeroFrequency

        public static void shiftZeroFrequency​(boofcv.struct.image.InterleavedF64 transform,
                                              boolean forward)
        Moves the zero-frequency component into the image center (width/2,height/2). This function can be called to undo the transform.
        Parameters:
        transform - the DFT which is to be shifted.
        forward - If true then it does the shift in the forward direction. If false then it undoes the transforms.
      • magnitude

        public static void magnitude​(boofcv.struct.image.InterleavedF32 transform,
                                     boofcv.struct.image.GrayF32 magnitude)
        Computes the magnitude of the complex image:
        magnitude = sqrt( real2 + imaginary2 )
        Parameters:
        transform - (Input) Complex interleaved image
        magnitude - (Output) Magnitude of image
      • magnitude

        public static void magnitude​(boofcv.struct.image.InterleavedF64 transform,
                                     boofcv.struct.image.GrayF64 magnitude)
        Computes the magnitude of the complex image:
        magnitude = sqrt( real2 + imaginary2 )
        Parameters:
        transform - (Input) Complex interleaved image
        magnitude - (Output) Magnitude of image
      • phase

        public static void phase​(boofcv.struct.image.InterleavedF32 transform,
                                 boofcv.struct.image.GrayF32 phase)
        Computes the phase of the complex image:
        phase = atan2( imaginary , real )
        Parameters:
        transform - (Input) Complex interleaved image
        phase - (output) Phase of image
      • phase

        public static void phase​(boofcv.struct.image.InterleavedF64 transform,
                                 boofcv.struct.image.GrayF64 phase)
        Computes the phase of the complex image:
        phase = atan2( imaginary , real )
        Parameters:
        transform - (Input) Complex interleaved image
        phase - (output) Phase of image
      • realToComplex

        public static void realToComplex​(boofcv.struct.image.GrayF32 real,
                                         boofcv.struct.image.InterleavedF32 complex)
        Converts a regular image into a complex interleaved image with the imaginary component set to zero.
        Parameters:
        real - (Input) Regular image.
        complex - (Output) Equivalent complex image.
      • realToComplex

        public static void realToComplex​(boofcv.struct.image.GrayF64 real,
                                         boofcv.struct.image.InterleavedF64 complex)
        Converts a regular image into a complex interleaved image with the imaginary component set to zero.
        Parameters:
        real - (Input) Regular image.
        complex - (Output) Equivalent complex image.
      • multiplyRealComplex

        public static void multiplyRealComplex​(boofcv.struct.image.GrayF32 realA,
                                               boofcv.struct.image.InterleavedF32 complexB,
                                               boofcv.struct.image.InterleavedF32 complexC)
        Performs element-wise complex multiplication between a real image and a complex image.
        Parameters:
        realA - (Input) Regular image
        complexB - (Input) Complex image
        complexC - (Output) Complex image
      • multiplyRealComplex

        public static void multiplyRealComplex​(boofcv.struct.image.GrayF64 realA,
                                               boofcv.struct.image.InterleavedF64 complexB,
                                               boofcv.struct.image.InterleavedF64 complexC)
        Performs element-wise complex multiplication between a real image and a complex image.
        Parameters:
        realA - (Input) Regular image
        complexB - (Input) Complex image
        complexC - (Output) Complex image
      • multiplyComplex

        public static void multiplyComplex​(boofcv.struct.image.InterleavedF32 complexA,
                                           boofcv.struct.image.InterleavedF32 complexB,
                                           boofcv.struct.image.InterleavedF32 complexC)
        Performs element-wise complex multiplication between two complex images.
        Parameters:
        complexA - (Input) Complex image
        complexB - (Input) Complex image
        complexC - (Output) Complex image
      • multiplyComplex

        public static void multiplyComplex​(boofcv.struct.image.InterleavedF64 complexA,
                                           boofcv.struct.image.InterleavedF64 complexB,
                                           boofcv.struct.image.InterleavedF64 complexC)
        Performs element-wise complex multiplication between two complex images.
        Parameters:
        complexA - (Input) Complex image
        complexB - (Input) Complex image
        complexC - (Output) Complex image