|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.pearsoneduc.ip.op.ImageFFT
Computes the FFT of an image, and the inverse FFT of its frequency domain representation. The transformed data can be inspected or filtered before performing the inverse transform.
FFTException
,
BufferedImage
Field Summary | |
static int |
BARTLETT_WINDOW
|
static int |
HAMMING_WINDOW
|
static int |
HANNING_WINDOW
|
static int |
NO_WINDOW
|
Constructor Summary | |
ImageFFT(java.awt.image.BufferedImage image)
Creates an ImageFFT for the specified image. |
|
ImageFFT(java.awt.image.BufferedImage image,
int win)
Creates an ImageFFT for the specified image, applying the specified windowing function to the data. |
Method Summary | |
static double |
bartlettWindow(double r,
double rmax)
Computes one half of a radial Bartlett windowing function. |
void |
butterworthBandPassFilter(double radius,
double delta)
Performs order-1 Butterworth band pass filtering of the spectrum. |
void |
butterworthBandPassFilter(int n,
double radius,
double delta)
Performs Butterworth band pass filtering of the spectrum. |
static double |
butterworthBandPassFunction(int n,
double radius,
double delta,
double r)
Computes the transfer function for a Butterworth band pass filter. |
void |
butterworthBandStopFilter(double radius,
double delta)
Performs order-1 Butterworth band stop filtering of the spectrum. |
void |
butterworthBandStopFilter(int n,
double radius,
double delta)
Performs Butterworth band stop filtering of the spectrum. |
static double |
butterworthBandStopFunction(int n,
double radius,
double delta,
double r)
Computes the transfer function of a Butterworth band stop filter. |
void |
butterworthHighPassFilter(double radius)
Performs order-1 Butterworth high pass filtering of the spectrum. |
void |
butterworthHighPassFilter(int n,
double radius)
Performs Butterworth high pass filtering of the spectrum. |
static double |
butterworthHighPassFunction(int n,
double radius,
double r)
Computes the transfer function for a Butterworth high pass filter. |
void |
butterworthLowPassFilter(double radius)
Performs order-1 Butterworth low pass filtering of the spectrum. |
void |
butterworthLowPassFilter(int n,
double radius)
Performs Butterworth low pass filtering of the spectrum. |
static double |
butterworthLowPassFunction(int n,
double radius,
double r)
Computes the transfer function for a Butterworth low pass filter. |
int |
getHeight()
|
float |
getMagnitude(int u,
int v)
Computes magnitude for any point in the spectrum. |
float |
getPhase(int u,
int v)
Computes phase for any point in the spectrum. |
java.awt.image.BufferedImage |
getSpectrum()
Returns the amplitude spectrum of an image, as another image. |
java.awt.image.BufferedImage |
getUnshiftedSpectrum()
Returns the amplitude spectrum of an image, as another image. |
int |
getWidth()
|
int |
getWindow()
|
static double |
hammingWindow(double r,
double rmax)
Computes one half of a radial Hamming windowing function. |
static double |
hanningWindow(double r,
double rmax)
Computes one half of a radial Hanning windowing function. |
void |
idealBandPassFilter(double radius,
double delta)
Performs ideal band pass filtering on the spectrum. |
void |
idealBandStopFilter(double radius,
double delta)
Performs ideal band stop filtering on the spectrum. |
void |
idealHighPassFilter(double radius)
Performs ideal high pass filtering on the spectrum. |
void |
idealLowPassFilter(double radius)
Performs ideal low pass filtering on the spectrum. |
boolean |
isSpectral()
|
void |
setMagnitude(int u,
int v,
float mag)
Modifies magnitude at any point in the spectrum. |
void |
setPhase(int u,
int v,
float phase)
Modifies phase at any point in the spectrum. |
java.awt.image.BufferedImage |
toImage(java.awt.image.BufferedImage image)
Converts stored data into an image. |
java.awt.image.BufferedImage |
toImage(java.awt.image.BufferedImage image,
int bias)
Converts stored data into an image. |
java.lang.String |
toString()
|
void |
transform()
Transforms data via a forward or inverse FFT, as appropriate. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
public static final int NO_WINDOW
public static final int BARTLETT_WINDOW
public static final int HAMMING_WINDOW
public static final int HANNING_WINDOW
Constructor Detail |
public ImageFFT(java.awt.image.BufferedImage image) throws FFTException
image
- input imagepublic ImageFFT(java.awt.image.BufferedImage image, int win) throws FFTException
image
- input imagewin
- windowing functionMethod Detail |
public static final double bartlettWindow(double r, double rmax)
r
- distance from centre of datarmax
- maximum distancepublic static final double hammingWindow(double r, double rmax)
r
- distance from centre of datarmax
- maximum distancepublic static final double hanningWindow(double r, double rmax)
r
- distance from centre of datarmax
- maximum distancepublic static final double butterworthLowPassFunction(int n, double radius, double r)
n
- order of filterradius
- filter radiusr
- distance from centre of spectrumpublic static final double butterworthHighPassFunction(int n, double radius, double r)
n
- order of filterradius
- filter radiusr
- distance from centre of spectrumpublic static final double butterworthBandPassFunction(int n, double radius, double delta, double r)
n
- order of filterradius
- filter radiusdelta
- band widthr
- distance from centre of spectrumpublic static final double butterworthBandStopFunction(int n, double radius, double delta, double r)
n
- order of filterradius
- filter radiusdelta
- band widthr
- distance from centre of spectrumpublic int getWidth()
public int getHeight()
public int getWindow()
public boolean isSpectral()
public java.lang.String toString()
public void transform()
public java.awt.image.BufferedImage toImage(java.awt.image.BufferedImage image) throws FFTException
image
- destination image, or nullpublic java.awt.image.BufferedImage toImage(java.awt.image.BufferedImage image, int bias) throws FFTException
image
- destination image, or nullbias
- constant value added to datapublic java.awt.image.BufferedImage getSpectrum() throws FFTException
public java.awt.image.BufferedImage getUnshiftedSpectrum() throws FFTException
public float getMagnitude(int u, int v) throws FFTException
u
- horizontal spatial frequencyv
- vertical spatial frequencypublic float getPhase(int u, int v) throws FFTException
u
- horizontal spatial frequencyv
- vertical spatial frequencypublic void setMagnitude(int u, int v, float mag) throws FFTException
u
- horizontal spatial frequencyv
- vertical spatial frequencymag
- new magnitiude for specified pointpublic void setPhase(int u, int v, float phase) throws FFTException
u
- horizontal spatial frequencyv
- vertical spatial frequencyphase
- new phase for specified pointpublic void idealLowPassFilter(double radius) throws FFTException
radius
- filter radiuspublic void idealHighPassFilter(double radius) throws FFTException
radius
- filter radiuspublic void idealBandPassFilter(double radius, double delta) throws FFTException
radius
- filter radiusdelta
- band widthpublic void idealBandStopFilter(double radius, double delta) throws FFTException
radius
- filter radiusdelta
- band widthpublic void butterworthLowPassFilter(double radius) throws FFTException
radius
- filter radiuspublic void butterworthLowPassFilter(int n, double radius) throws FFTException
n
- order of filterradius
- filter radiuspublic void butterworthHighPassFilter(double radius) throws FFTException
radius
- filter radiuspublic void butterworthHighPassFilter(int n, double radius) throws FFTException
n
- order of filterradius
- filter radiuspublic void butterworthBandPassFilter(double radius, double delta) throws FFTException
radius
- filter radiusdelta
- band widthpublic void butterworthBandPassFilter(int n, double radius, double delta) throws FFTException
n
- order of filterradius
- filter radiusdelta
- band widthpublic void butterworthBandStopFilter(double radius, double delta) throws FFTException
radius
- filter radiusdelta
- band widthpublic void butterworthBandStopFilter(int n, double radius, double delta) throws FFTException
n
- order of filterradius
- filter radiusdelta
- band width
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |