Package boofcv.alg.transform.fft
Class DiscreteFourierTransformOps
java.lang.Object
boofcv.alg.transform.fft.DiscreteFourierTransformOps
Various functions related to
DiscreteFourierTransform
.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
checkImageArguments
(ImageBase image, ImageInterleaved transform) Checks to see if the image and its transform are appropriate sizes .Creates aDiscreteFourierTransform
for images of typeGrayF32
.Creates aDiscreteFourierTransform
for images of typeGrayF64
.static boolean
isPowerOf2
(int x) true if the number provided is a power of twostatic void
magnitude
(InterleavedF32 transform, GrayF32 magnitude) Computes the magnitude of the complex image:
magnitude = sqrt( real2 + imaginary2 )static void
magnitude
(InterleavedF64 transform, GrayF64 magnitude) Computes the magnitude of the complex image:
magnitude = sqrt( real2 + imaginary2 )static void
multiplyComplex
(InterleavedF32 complexA, InterleavedF32 complexB, InterleavedF32 complexC) Performs element-wise complex multiplication between two complex images.static void
multiplyComplex
(InterleavedF64 complexA, InterleavedF64 complexB, InterleavedF64 complexC) Performs element-wise complex multiplication between two complex images.static void
multiplyRealComplex
(GrayF32 realA, InterleavedF32 complexB, InterleavedF32 complexC) Performs element-wise complex multiplication between a real image and a complex image.static void
multiplyRealComplex
(GrayF64 realA, InterleavedF64 complexB, 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
(InterleavedF32 transform, GrayF32 phase) Computes the phase of the complex image:
phase = atan2( imaginary , real )static void
phase
(InterleavedF64 transform, GrayF64 phase) Computes the phase of the complex image:
phase = atan2( imaginary , real )static void
realToComplex
(GrayF32 real, InterleavedF32 complex) Converts a regular image into a complex interleaved image with the imaginary component set to zero.static void
realToComplex
(GrayF64 real, InterleavedF64 complex) Converts a regular image into a complex interleaved image with the imaginary component set to zero.static void
shiftZeroFrequency
(InterleavedF32 transform, boolean forward) Moves the zero-frequency component into the image center (width/2,height/2).static void
shiftZeroFrequency
(InterleavedF64 transform, boolean forward) Moves the zero-frequency component into the image center (width/2,height/2).
-
Constructor Details
-
DiscreteFourierTransformOps
public DiscreteFourierTransformOps()
-
-
Method Details
-
createTransformF32
Creates aDiscreteFourierTransform
for images of typeGrayF32
.- Returns:
DiscreteFourierTransform
- See Also:
-
createTransformF64
Creates aDiscreteFourierTransform
for images of typeGrayF64
.- Returns:
DiscreteFourierTransform
- See Also:
-
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.- Returns:
- the closest power-of-two number greater than or equal to x
-
checkImageArguments
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 imagetransform
- Storage for a Fourier Transform
-
shiftZeroFrequency
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
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
Computes the magnitude of the complex image:
magnitude = sqrt( real2 + imaginary2 )- Parameters:
transform
- (Input) Complex interleaved imagemagnitude
- (Output) Magnitude of image
-
magnitude
Computes the magnitude of the complex image:
magnitude = sqrt( real2 + imaginary2 )- Parameters:
transform
- (Input) Complex interleaved imagemagnitude
- (Output) Magnitude of image
-
phase
Computes the phase of the complex image:
phase = atan2( imaginary , real )- Parameters:
transform
- (Input) Complex interleaved imagephase
- (output) Phase of image
-
phase
Computes the phase of the complex image:
phase = atan2( imaginary , real )- Parameters:
transform
- (Input) Complex interleaved imagephase
- (output) Phase of image
-
realToComplex
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
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(GrayF32 realA, InterleavedF32 complexB, InterleavedF32 complexC) Performs element-wise complex multiplication between a real image and a complex image.- Parameters:
realA
- (Input) Regular imagecomplexB
- (Input) Complex imagecomplexC
- (Output) Complex image
-
multiplyRealComplex
public static void multiplyRealComplex(GrayF64 realA, InterleavedF64 complexB, InterleavedF64 complexC) Performs element-wise complex multiplication between a real image and a complex image.- Parameters:
realA
- (Input) Regular imagecomplexB
- (Input) Complex imagecomplexC
- (Output) Complex image
-
multiplyComplex
public static void multiplyComplex(InterleavedF32 complexA, InterleavedF32 complexB, InterleavedF32 complexC) Performs element-wise complex multiplication between two complex images.- Parameters:
complexA
- (Input) Complex imagecomplexB
- (Input) Complex imagecomplexC
- (Output) Complex image
-
multiplyComplex
public static void multiplyComplex(InterleavedF64 complexA, InterleavedF64 complexB, InterleavedF64 complexC) Performs element-wise complex multiplication between two complex images.- Parameters:
complexA
- (Input) Complex imagecomplexB
- (Input) Complex imagecomplexC
- (Output) Complex image
-