public abstract class FourierDescriptor extends Object implements Cloneable
Modifier and Type | Field and Description |
---|---|
protected Complex[] |
g |
protected Complex[] |
G |
protected double |
reconstructionScale |
Constructor and Description |
---|
FourierDescriptor() |
Modifier and Type | Method and Description |
---|---|
FourierDescriptor |
clone() |
double |
distanceComplex(FourierDescriptor fd2) |
double |
distanceComplex(FourierDescriptor fd2,
int Mp) |
double |
distanceMagnitude(FourierDescriptor fd2) |
double |
distanceMagnitude(FourierDescriptor fd2,
int Mp) |
Complex |
getCoefficient(int m) |
int |
getCoefficientIndex(int m) |
Complex[] |
getCoefficients() |
Complex |
getEllipsePoint(Complex G1,
Complex G2,
int m,
double t)
Get the reconstructed point for two DFT coefficients G1, G2 at a given
position t.
|
int |
getMaxCoefficientPairs() |
double |
getMaxDftMagnitude() |
int |
getMaxDftMagnitudeIndex() |
int |
getMaxNegHarmonic() |
int |
getMaxPosHarmonic() |
Complex[] |
getReconstruction(int N)
Calculates a reconstruction from the full DFT spectrum with N samples.
|
Complex[] |
getReconstruction(int N,
int Mp)
Calculate a reconstruction from the partial DFT spectrum with N sample
points and using Mp coefficient pairs.
|
Complex |
getReconstructionPoint(double t)
Reconstructs a single spatial point from the complete FD
at the fractional path position t in [0,1].
|
Complex |
getReconstructionPoint(double t,
int Mp) |
double |
getReconstructionScale() |
Complex[] |
getSamples() |
double |
getStartPointPhase(int Mp)
Calculates the 'canonical' start point.
|
protected static Complex[] |
makeComplex(Point2D[] points) |
Path2D |
makeEllipse(Complex G1,
Complex G2,
int m,
double xOffset,
double yOffset) |
Path2D |
makeFourierPairsReconstruction()
Reconstructs the shape using all FD pairs.
|
Path2D |
makeFourierPairsReconstruction(int Mp)
Reconstructs the shape obtained from FD-pairs 0,...,Mp as a polygon (path).
|
FourierDescriptor[] |
makeInvariant() |
FourierDescriptor[] |
makeInvariant(int Mp) |
double |
makeRotationInvariant() |
double |
makeScaleInvariant()
Normalizes this descriptor destructively to the L2 norm of G,
keeps G_0 untouched.
|
FourierDescriptor[] |
makeStartPointInvariant() |
void |
makeTranslationInvariant()
Sets the zero (DC) coefficient to zero.
|
void |
rotate(double phi)
For testing: apply shape rotation to this FourierDescriptor (phi in radians)
|
void |
setCoefficient(int m,
Complex z) |
void |
setCoefficient(int m,
double a,
double b) |
int |
size() |
FourierDescriptor |
truncate(int Mp)
Truncates this Fourier descriptor to the
Mp lowest-frequency coefficients. |
protected double reconstructionScale
public FourierDescriptor()
public double getReconstructionScale()
public FourierDescriptor truncate(int Mp)
Mp
lowest-frequency coefficients.
For example, the original Fourier descriptor with 10 coefficients a,b,...,j
m = 0 1 2 3 4 5 6 7 8 9 G[m] = a b c d e f g h i jbecomes (with
P
= 3)
m = 0 1 2 3 4 5 6 G[m] = a b c d h i j
Mp
- number of coefficients to remainFourierDescriptor
public FourierDescriptor clone()
public int getMaxNegHarmonic()
public int getMaxPosHarmonic()
public int getMaxCoefficientPairs()
protected static Complex[] makeComplex(Point2D[] points)
public Complex[] getSamples()
public Complex[] getCoefficients()
public int size()
public int getCoefficientIndex(int m)
public Complex getCoefficient(int m)
public void setCoefficient(int m, Complex z)
public void setCoefficient(int m, double a, double b)
public Complex[] getReconstruction(int N)
N
- number of samplespublic Complex[] getReconstruction(int N, int Mp)
N
- number of samplesMp
- number of coefficient pairspublic Complex getReconstructionPoint(double t)
t
- path positionpublic Complex getReconstructionPoint(double t, int Mp)
public Path2D makeEllipse(Complex G1, Complex G2, int m, double xOffset, double yOffset)
public Complex getEllipsePoint(Complex G1, Complex G2, int m, double t)
G1
- first coefficientG2
- second coefficientm
- frequency numbert
- contour positionpublic Path2D makeFourierPairsReconstruction()
public Path2D makeFourierPairsReconstruction(int Mp)
Mp
- number of Fourier coefficient pairspublic int getMaxDftMagnitudeIndex()
public double getMaxDftMagnitude()
public FourierDescriptor[] makeInvariant()
public FourierDescriptor[] makeInvariant(int Mp)
public FourierDescriptor[] makeStartPointInvariant()
public void makeTranslationInvariant()
public double makeScaleInvariant()
public double makeRotationInvariant()
public void rotate(double phi)
phi
- rotation anglepublic double getStartPointPhase(int Mp)
Mp
- number of Fourier coefficient pairspublic double distanceComplex(FourierDescriptor fd2)
public double distanceComplex(FourierDescriptor fd2, int Mp)
public double distanceMagnitude(FourierDescriptor fd2)
public double distanceMagnitude(FourierDescriptor fd2, int Mp)
Copyright © 2006–2017, Wilhelm Burger, Mark J. Burge (BSD 2-Clause Simplified License)