zsig 1.0.0
|
Zernike Polynomials Orthogonal Basis type. More...
#include <zpolbasist.hh>
Public Types | |
typedef ZernikePolynomialsBasisT < Order, T > | zpolbasis_type |
This class type. | |
typedef std::complex< T > | value_type |
Polynomial value type. | |
typedef std::vector< value_type > | radial_polynomial |
Radial polynomial. | |
Public Member Functions | |
ZernikePolynomialsBasisT () | |
Default Constructor. | |
void | project (const T **_fxy, const zpolbasis_type **_zpb, const unsigned int &_szx, const unsigned int &_szy) |
Compute the projection of a function onto the Zernike basis. | |
void | project (const T **_fxy, zpolbasis_type **_zpb, const unsigned int &_szx, const unsigned int &_szy) |
void | project (T **_fxy, const zpolbasis_type **_zpb, const unsigned int &_szx, const unsigned int &_szy) |
void | project (T **_fxy, zpolbasis_type **_zpb, const unsigned int &_szx, const unsigned int &_szy) |
void | project (const T **_fxy, const unsigned int &_szx, const unsigned int &_szy) |
void | project (T **_fxy, const unsigned int &_szx, const unsigned int &_szy) |
void | reconstruct (T **_fxy, const zpolbasis_type **_zpb, const unsigned int &_szx, const unsigned int &_szy) const |
Compute the reconstruction of a function using the Zernike basis. | |
void | reconstruct (T **_fxy, zpolbasis_type **_zpb, const unsigned int &_szx, const unsigned int &_szy) const |
void | reconstruct (T **_fxy, const unsigned int &_szx, const unsigned int &_szy) const |
T | compare (const zpolbasis_type &_zp) const |
Compare two Zernike polynomials representations. | |
radial_polynomial & | operator[] (const unsigned &_p) |
Read/write operator of each radial polynomial. | |
const radial_polynomial & | operator[] (const unsigned &_p) const |
Read operator of each radial polynomial. | |
Friends | |
std::ostream & | operator<< (std::ostream &_out, const zpolbasis_type &_z) |
Output stream operator. | |
std::istream & | operator>> (std::istream &_in, zpolbasis_type &_z) |
Input stream operator. | |
Related Functions | |
(Note that these are not member functions.) | |
template<class T > | |
T | fac (const int &_n) |
Compute factorial of n: . | |
template<class T > | |
T | compute_R (const unsigned &_p, const int &_q, const T &_r) |
Compute Radial Polynomial: . | |
template<class T > | |
std::complex< T > | compute_V (const unsigned &_p, const int &_q, const T &_r, const T &_t) |
Compute Zernike Polynomial: . | |
template<unsigned Order, class T > | |
void | compute_basis (ZernikePolynomialsBasisT< Order, T > **_zpb, const unsigned int &_szx, const unsigned int &_szy) |
Compute Discrete Zernike Basis: all . | |
template<unsigned Order, class T , unsigned R, unsigned C> | |
void | compute_zsig (std::vector< ZernikePolynomialsBasisT< Order, T > > &_zsig, const SignatureMeshT< T > &_m, const std::vector< SignatureT< R, C, T > > &_sig) |
Compute Zernike Signature for vertices. | |
template<unsigned Order, class T , unsigned R, unsigned C> | |
void | compute_zsig (std::vector< ZernikePolynomialsBasisT< Order, T > > &_zsig, const SignatureMeshT< T > &_m) |
template<unsigned Order, class T , unsigned R, unsigned C> | |
void | compute_gwzsig (std::vector< ZernikePolynomialsBasisT< Order, T > > &_gwzsig, const SignatureMeshT< T > &_m, const std::vector< ZernikePolynomialsBasisT< Order, T > > &_zsig) |
Compute Gaussian-weighted Zernike Signature for vertices. | |
template<unsigned Order, class T , unsigned R, unsigned C> | |
void | compute_gwzsig (std::vector< ZernikePolynomialsBasisT< Order, T > > &_gwzsig, const SignatureMeshT< T > &_m) |
Zernike Polynomials Orthogonal Basis type.
This class is inspired from Zernike's work:
@ARTICLE{Zernike:1934, author = {{F}. {Z}ernike}, title = {{B}eugungstheorie des {S}chneidenverfahrens und seiner verbesserten {F}orm, der {P}hasenkontrastmethode}, journal = {Physica 1}, pages = {689--704}, year = {1934} }
The computational perspective of this class follows the basic idea on the paper:
@INPROCEEDINGS{Khotanzad:1988, author = {{K}hotanzad, {A}. and {H}ong, {Y}. {H}.}, title = {Rotation invariant pattern recognition using {Z}ernike moments}, booktitle = {9th {I}nternational {C}onference on {P}attern {R}ecognition}, year = {1988}, month = {Nov}, volume = {1}, pages = {326--328}, doi = {http://dx.doi.org/10.1109/ICPR.1988.28233} }
However, the implementation of this class targets (and follows more closely) the paper (first-authored by me):
@ARTICLE{Maximo:2011, author = {A. Maximo and R. Patro and A. Varshney and R. Farias}, title = {A Robust and Rotationally Invariant Local Surface Descriptor with Applications to Non-local Mesh Processing}, journal = {Graphical Models}, volume = {In Press, Accepted Manuscript}, number = {} pages = { - }, year = {2011}, issn = {1524-0703}, doi = {http://dx.doi.org/10.1016/j.gmod.2011.05.002} }
Order | Defines Zernike target radial order |
T | Defines number precision |
app_compute_signature.cc, app_paint_signature.cc, example_sig.cc, example_zpol.cc, and example_zproj.cc.
Definition at line 163 of file zpolbasist.hh.
typedef ZernikePolynomialsBasisT< Order, T > zsig::ZernikePolynomialsBasisT< Order, T >::zpolbasis_type |
This class type.
Definition at line 167 of file zpolbasist.hh.
typedef std::complex< T > zsig::ZernikePolynomialsBasisT< Order, T >::value_type |
Polynomial value type.
Definition at line 168 of file zpolbasist.hh.
typedef std::vector< value_type > zsig::ZernikePolynomialsBasisT< Order, T >::radial_polynomial |
Radial polynomial.
Definition at line 169 of file zpolbasist.hh.
zsig::ZernikePolynomialsBasisT< Order, T >::ZernikePolynomialsBasisT | ( | ) | [inline] |
Default Constructor.
This class does not store: q[-4, -2, 0, 2, 4] instead it stores only: q[0, 2, 4]; since the complex conjugate of q and -q are the same V_{p}^{q} = V*_{p}^{-q}.
Definition at line 177 of file zpolbasist.hh.
void zsig::ZernikePolynomialsBasisT< Order, T >::project | ( | const T ** | _fxy, |
const zpolbasis_type ** | _zpb, | ||
const unsigned int & | _szx, | ||
const unsigned int & | _szy | ||
) | [inline] |
Compute the projection of a function onto the Zernike basis.
This method projects a function onto the Zernike Polynomials Orthogonal Basis as described in equation (3) below (see [Maximo:2011] -- the discrete version). This projection is the associated with all possible orders and repetitions as follows:
The domain of the function is considered to be a discrete grid (of a given size) in the range [-1, 1] and it is converted to polar coordinates , evaluating only in the unit circle (where the Zernike basis is defined) centered at the origin.
[in] | _fxy | Discrete function to look up values (at [x, y] or _fxy[x][y]) |
[in] | _zpb | Zernike Polynomials Basis for each [x, y] |
[in] | _szx | Function domain size on the x-direction |
[in] | _szy | Function domain size on the y-direction |
Definition at line 211 of file zpolbasist.hh.
void zsig::ZernikePolynomialsBasisT< Order, T >::project | ( | const T ** | _fxy, |
zpolbasis_type ** | _zpb, | ||
const unsigned int & | _szx, | ||
const unsigned int & | _szy | ||
) | [inline] |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
[in] | _fxy | Discrete function to look up values (at [x, y] or _fxy[x][y]) |
[in] | _zpb | Zernike Polynomials Basis for each [x, y] |
[in] | _szx | Function domain size on the x-direction |
[in] | _szy | Function domain size on the y-direction |
Definition at line 241 of file zpolbasist.hh.
References zsig::ZernikePolynomialsBasisT< Order, T >::project().
void zsig::ZernikePolynomialsBasisT< Order, T >::project | ( | T ** | _fxy, |
const zpolbasis_type ** | _zpb, | ||
const unsigned int & | _szx, | ||
const unsigned int & | _szy | ||
) | [inline] |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
[in] | _fxy | Discrete function to look up values (at [x, y] or _fxy[x][y]) |
[in] | _zpb | Zernike Polynomials Basis for each [x, y] |
[in] | _szx | Function domain size on the x-direction |
[in] | _szy | Function domain size on the y-direction |
Definition at line 255 of file zpolbasist.hh.
References zsig::ZernikePolynomialsBasisT< Order, T >::project().
void zsig::ZernikePolynomialsBasisT< Order, T >::project | ( | T ** | _fxy, |
zpolbasis_type ** | _zpb, | ||
const unsigned int & | _szx, | ||
const unsigned int & | _szy | ||
) | [inline] |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
[in] | _fxy | Discrete function to look up values (at [x, y] or _fxy[x][y]) |
[in] | _zpb | Zernike Polynomials Basis for each [x, y] |
[in] | _szx | Function domain size on the x-direction |
[in] | _szy | Function domain size on the y-direction |
Definition at line 269 of file zpolbasist.hh.
References zsig::ZernikePolynomialsBasisT< Order, T >::project().
void zsig::ZernikePolynomialsBasisT< Order, T >::project | ( | const T ** | _fxy, |
const unsigned int & | _szx, | ||
const unsigned int & | _szy | ||
) | [inline] |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
The overloaded version of the project method does not use the Discrete Zernike Basis and, therefore, has to compute the complex conjugate of V ( ) as in compute_basis.
[in] | _fxy | Discrete function to look up values (at [x, y] or _fxy[x][y]) |
[in] | _szx | Function domain size on the x-direction |
[in] | _szy | Function domain size on the y-direction |
Definition at line 287 of file zpolbasist.hh.
References zsig::ZernikePolynomialsBasisT< Order, T >::compute_V().
void zsig::ZernikePolynomialsBasisT< Order, T >::project | ( | T ** | _fxy, |
const unsigned int & | _szx, | ||
const unsigned int & | _szy | ||
) | [inline] |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
[in] | _fxy | Discrete function to look up values (at [x, y] or _fxy[x][y]) |
[in] | _szx | Function domain size on the x-direction |
[in] | _szy | Function domain size on the y-direction |
Definition at line 317 of file zpolbasist.hh.
References zsig::ZernikePolynomialsBasisT< Order, T >::project().
void zsig::ZernikePolynomialsBasisT< Order, T >::reconstruct | ( | T ** | _fxy, |
const zpolbasis_type ** | _zpb, | ||
const unsigned int & | _szx, | ||
const unsigned int & | _szy | ||
) | const [inline] |
Compute the reconstruction of a function using the Zernike basis.
This method reconstructs a function using the Zernike Polynomials Orthogonal Basis, considering this polynomial object as the representation of the function via Zernike coefficients and a given Zernike Polynomial Basis as .
[out] | _fxy | Discrete function to reconstruct (at [x, y] or _fxy[x][y]) |
[in] | _zpb | Zernike Polynomials Basis for each [x, y] |
[in] | _szx | Function domain size on the x-direction |
[in] | _szy | Function domain size on the y-direction |
Definition at line 336 of file zpolbasist.hh.
void zsig::ZernikePolynomialsBasisT< Order, T >::reconstruct | ( | T ** | _fxy, |
zpolbasis_type ** | _zpb, | ||
const unsigned int & | _szx, | ||
const unsigned int & | _szy | ||
) | const [inline] |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
[out] | _fxy | Discrete function to reconstruct (at [x, y] or _fxy[x][y]) |
[in] | _zpb | Zernike Polynomials Basis for each [x, y] |
[in] | _szx | Function domain size on the x-direction |
[in] | _szy | Function domain size on the y-direction |
Definition at line 363 of file zpolbasist.hh.
References zsig::ZernikePolynomialsBasisT< Order, T >::reconstruct().
void zsig::ZernikePolynomialsBasisT< Order, T >::reconstruct | ( | T ** | _fxy, |
const unsigned int & | _szx, | ||
const unsigned int & | _szy | ||
) | const [inline] |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
The overloaded version of the reconstruct method does not use the Discrete Zernike Basis and, therefore, has to compute V ( ) as in compute_basis.
[out] | _fxy | Discrete function to reconstruct (at [x, y] or _fxy[x][y]) |
[in] | _szx | Function domain size on the x-direction |
[in] | _szy | Function domain size on the y-direction |
Definition at line 380 of file zpolbasist.hh.
References zsig::ZernikePolynomialsBasisT< Order, T >::compute_V().
T zsig::ZernikePolynomialsBasisT< Order, T >::compare | ( | const zpolbasis_type & | _zp | ) | const [inline] |
Compare two Zernike polynomials representations.
The representation of a function is given by the Zernike coefficients computed by the projection into the basis. This method compares this polynomial coefficients with a given another polynomial coefficients computing the Euclidean distance between the two in Zernike space.
[in] | _zp | Zernike polynomial to compare to |
Definition at line 419 of file zpolbasist.hh.
radial_polynomial& zsig::ZernikePolynomialsBasisT< Order, T >::operator[] | ( | const unsigned & | _p | ) | [inline] |
Read/write operator of each radial polynomial.
[in] | _p | Radial order |
Definition at line 437 of file zpolbasist.hh.
const radial_polynomial& zsig::ZernikePolynomialsBasisT< Order, T >::operator[] | ( | const unsigned & | _p | ) | const [inline] |
Read operator of each radial polynomial.
[in] | _p | Radial order |
Definition at line 444 of file zpolbasist.hh.
std::ostream& operator<< | ( | std::ostream & | _out, |
const zpolbasis_type & | _z | ||
) | [friend] |
Output stream operator.
[in,out] | _out | Output stream |
[in] | _z | Zernike Polynomials Basis to output |
Definition at line 452 of file zpolbasist.hh.
std::istream& operator>> | ( | std::istream & | _in, |
zpolbasis_type & | _z | ||
) | [friend] |
Input stream operator.
[in,out] | _in | Input stream |
[out] | _z | Zernike Polynomials Basis to input |
Definition at line 469 of file zpolbasist.hh.
T fac | ( | const int & | _n | ) | [related] |
Compute factorial of n: .
[in] | _n | Number to compute the factorial of |
T | Defines number precision |
Definition at line 33 of file zpolbasist.hh.
T compute_R | ( | const unsigned & | _p, |
const int & | _q, | ||
const T & | _r | ||
) | [related] |
Compute Radial Polynomial: .
This function computes the value returned by equation (1) below (see [Maximo:2011]), that is the Radial Polynomial associated with order and repetition as follows:
[in] | _p | Radial order |
[in] | _q | Frequency repetition |
[in] | _r | Domain radius to compute the polynomial |
T | Defines number precision |
Definition at line 61 of file zpolbasist.hh.
std::complex< T > compute_V | ( | const unsigned & | _p, |
const int & | _q, | ||
const T & | _r, | ||
const T & | _t | ||
) | [related] |
Compute Zernike Polynomial: .
This function computes the value returned by equation (2) below (see [Maximo:2011]), that is the Zernike Polynomial associated with order and repetition as follows:
[in] | _p | Radial order |
[in] | _q | Frequency repetition |
[in] | _r | Domain radius to compute the polynomial |
[in] | _t | Domain angle to compute the polynomial |
T | Defines number precision |
Definition at line 102 of file zpolbasist.hh.
void compute_basis | ( | ZernikePolynomialsBasisT< Order, T > ** | _zpb, |
const unsigned int & | _szx, | ||
const unsigned int & | _szy | ||
) | [related] |
Compute Discrete Zernike Basis: all .
This function computes the orthogonal basis used in equation (3) below (from [Maximo:2011] -- the discrete version), that is the Zernike basis associated with all possible orders and repetitions related with the target function to be projected, as follows:
The domain of the function is considered to be a discrete grid (of a given size) in the range [-1, 1] and it is converted to polar coordinates , evaluating only in the unit circle (where the Zernike basis is defined) centered at the origin.
[out] | _zpb | Zernike Polynomials Basis for each [x, y] |
[in] | _szx | Domain size of the x-direction |
[in] | _szy | Domain size of the y-direction |
O | Defines Zernike target radial order |
T | Defines number precision |
Definition at line 524 of file zpolbasist.hh.
void compute_zsig | ( | std::vector< ZernikePolynomialsBasisT< Order, T > > & | _zsig, |
const SignatureMeshT< T > & | _m, | ||
const std::vector< SignatureT< R, C, T > > & | _sig | ||
) | [related] |
Compute Zernike Signature for vertices.
Given a mesh _m and the Heighmap-based vertex signatures _sig (see compute_sig function), compute the Zernike-based vertex signatures for all mesh vertices. The output is a vector of Zernike signatures _zsig.
[out] | _zsig | Zernike-based vertex signatures |
[in] | _m | Mesh to compute signatures of vertices |
[in] | _sig | Heightmap-based vertex signatures previous computed |
Order | Defines Zernike target radial order |
T | Signature value type |
R | Signature row dimension |
C | Signature column dimension |
Definition at line 182 of file zsig.hh.
References zsig::SignatureT< R, C, T >::clear(), and zsig::SignatureMeshT< T >::size_of_vertices().
void compute_zsig | ( | std::vector< ZernikePolynomialsBasisT< Order, T > > & | _zsig, |
const SignatureMeshT< T > & | _m | ||
) | [related] |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
[out] | _zsig | Zernike-based vertex signatures |
[in] | _m | Mesh to compute signatures of vertices |
Order | Defines Zernike target radial order |
T | Signature value type |
R | Signature row dimension |
C | Signature column dimension |
void compute_gwzsig | ( | std::vector< ZernikePolynomialsBasisT< Order, T > > & | _gwzsig, |
const SignatureMeshT< T > & | _m, | ||
const std::vector< ZernikePolynomialsBasisT< Order, T > > & | _zsig | ||
) | [related] |
Compute Gaussian-weighted Zernike Signature for vertices.
Given a mesh _m and the Zernike-based vertex signatures _zsig (see compute_zsig function), compute the Gaussian-weighted Zernike-based vertex signatures for all mesh vertices. The output is a vector of Gaussian-weighted Zernike signatures _gwzsig. This new vector of Zernike coefficients is computed using equation (1) below (see [Maximo:2011] cited in ZernikePolynomialsBasisT) as follows:
[out] | _gwzsig | Gaussian-weighted Zernike-based vertex signatures |
[in] | _m | Mesh to compute signatures of vertices |
[in] | _zsig | Zernike-based vertex signatures previous computed |
Order | Defines Zernike target radial order |
T | Signature value type |
R | Signature row dimension |
C | Signature column dimension |
Definition at line 257 of file zsig.hh.
References zsig::vec< D, T >::clear(), zsig::SignatureMeshT< T >::compute_neighborhood(), zsig::SignatureMeshT< T >::maximum_search_distance(), zsig::SignatureMeshT< T >::size_of_vertices(), and zsig::SignatureMeshT< T >::vertices().
void compute_gwzsig | ( | std::vector< ZernikePolynomialsBasisT< Order, T > > & | _gwzsig, |
const SignatureMeshT< T > & | _m | ||
) | [related] |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
[out] | _gwzsig | Gaussian-weighted Zernike-based vertex signatures |
[in] | _m | Mesh to compute signatures of vertices |
Order | Defines Zernike target radial order |
T | Signature value type |
R | Signature row dimension |
C | Signature column dimension |