20 # include <vcl_msvc_warnings.h> 22 #include <vnl/vnl_math.h> 84 inline T
a()
const {
return a_; }
87 inline T
b()
const {
return b_; }
90 inline T
c()
const {
return c_; }
93 inline T
d()
const {
return d_; }
96 inline T
e()
const {
return e_; }
99 inline T
f()
const {
return f_; }
102 inline T
g()
const {
return g_; }
105 inline T
h()
const {
return h_; }
108 inline T
i()
const {
return i_; }
111 inline T
j()
const {
return j_; }
149 vgl_quadric_3d(std::vector<T>
const& diag, std::vector<std::vector<T> >
const& H);
154 void set(std::vector<std::vector<T> >
const& Q);
180 void upper_3x3_eigensystem(std::vector<T>& eigenvalues, std::vector<std::vector<T> >& eigenvectors)
const;
191 std::vector<std::vector<T> >
canonical_quadric(std::vector<std::vector<T> >& H)
const;
209 template <
class T,
size_t n>
210 void eigen(T m[n][n], T
l[n], T vc[n][n]);
213 template <
class T,
size_t n>
214 void twst(T m[n][n], T c, T s,
int i,
int j);
216 #define VGL_QUADRIC_3D_INSTANTIATE(T) extern "please include vgl/vgl_quadric_3d.hxx first" 218 #endif // vgl_quadric_3d_h_
T h() const
Returns the coefficient of .
point in projective 3D space
bool operator==(vgl_quadric_3d< T > const &c) const
comparison operator.
T b() const
Returns the coefficient of .
bool center(vgl_point_3d< T > ¢er) const
if the upper 3x3 submatrix of Q is full rank then the center of the quadric can be defined.
bool is_degenerate() const
Returns true if this quadric is degenerate.
vgl_quadric_type type() const
bool on(vgl_homg_point_3d< T > const &pt, T tol=T(0)) const
Returns true if the point pt belongs to the quadric surface.
T c() const
Returns the coefficient of .
T j() const
Returns the coefficient of .
std::vector< std::vector< T > > coef_matrix() const
return a matrix of quadric coefficients of the form:.
void upper_3x3_eigensystem(std::vector< T > &eigenvalues, std::vector< std::vector< T > > &eigenvectors) const
: eigenvalues and eigenvectors of the upper 3x3 quadric matrix.
std::vector< std::vector< T > > canonical_quadric(std::vector< std::vector< T > > &H) const
The quadric coefficient matrix in the canonical frame, whether or not the quadric is central.
std::ostream & operator<<(std::ostream &s, vgl_orient_box_3d< Type > const &p)
Write box to stream.
Represents a homogeneous 3D point.
static vgl_quadric_type type_by_name(std::string const &name)
Returns the internal enum value corresponding to the string argument.
T e() const
Returns the coefficient of .
void set(T a, T b, T c, T d, T e, T f, T g, T h, T i, T j)
set or reset the quadric using polynomial coefficients.
a point in 3D nonhomogeneous space
void twst(T m[n][n], T c, T s, int i, int j)
Auxillary function used by eigen.
void eigen(T m[n][n], T l[n], T vc[n][n])
Computes the eigensystem for real symmetric matrices. Used to classify quadrics.
T sampson_dist(vgl_homg_point_3d< T > const &pt) const
Sampson distance d_sampson(p) = ||p^t Q p||^2/||grad(p*t Q p)||^2.
T f() const
Returns the coefficient of .
T d() const
Returns the coefficient of .
std::istream & operator>>(std::istream &is, vgl_orient_box_3d< Type > &p)
Read box from stream.
void compute_type()
set quadric type from polynomial coefficients and store in member type_.
T a() const
Returns the coefficient of .
T g() const
Returns the coefficient of .
T i() const
Returns the coefficient of .
bool canonical_central_quadric(std::vector< T > &diag, std::vector< std::vector< T > > &H) const
: The quadric in its canonical frame if the center is defined, i.e. the upper 3x3 quadric matrix is f...
static std::string type_by_number(vgl_quadric_type const &type)
Converts the quadric type from enum (internal representation) to string.