44 #include <visp3/visual_features/vpBasicFeature.h> 45 #include <visp3/visual_features/vpFeatureEllipse.h> 48 #include <visp3/core/vpException.h> 49 #include <visp3/visual_features/vpFeatureException.h> 52 #include <visp3/core/vpDebug.h> 55 #include <visp3/core/vpMath.h> 57 #include <visp3/core/vpFeatureDisplay.h> 95 if (
flags[i] ==
false) {
98 vpTRACE(
"Warning !!! The interaction matrix is computed but x was " 102 vpTRACE(
"Warning !!! The interaction matrix is computed but y was " 106 vpTRACE(
"Warning !!! The interaction matrix is computed but n20 " 110 vpTRACE(
"Warning !!! The interaction matrix is computed but n11 " 114 vpTRACE(
"Warning !!! The interaction matrix is computed but n02 " 118 vpTRACE(
"Warning !!! The interaction matrix is computed but A was " 122 vpTRACE(
"Warning !!! The interaction matrix is computed but B was " 126 vpTRACE(
"Warning !!! The interaction matrix is computed but C was " 130 vpTRACE(
"Problem during the reading of the variable flags");
143 double Zinv = A * xc + B * yc + C;
151 H[0][2] = xc * Zinv + 4.0 * (A * n20 + B * n11);
152 H[0][3] = xc * yc + 4.0 * n11;
165 H[0][2] = yc * Zinv + 4.0 * (A * n11 + B * n02);
167 H[0][4] = -xc * yc - 4.0 * n11;
177 H[0][0] = -2.0 * (A * n20 + B * n11);
179 H[0][2] = 2 * ((Zinv + A * xc) * n20 + B * xc * n11);
180 H[0][3] = 2 * (yc * n20 + xc * n11);
181 H[0][4] = -4 * n20 * xc;
191 H[0][0] = -A * n11 - B * n02;
192 H[0][1] = -A * n20 - B * n11;
193 H[0][2] = A * yc * n20 + (3 * Zinv - C) * n11 + B * xc * n02;
194 H[0][3] = 3 * yc * n11 + xc * n02;
195 H[0][4] = -yc * n20 - 3 * xc * n11;
206 H[0][1] = -2 * (A * n11 + B * n02);
207 H[0][2] = 2 * ((Zinv + B * yc) * n02 + A * yc * n11);
208 H[0][3] = 4 * yc * n02;
209 H[0][4] = -2 * (yc * n11 + xc * n02);
226 ex[0] =
s[0] - s_star[0];
233 ey[0] =
s[1] - s_star[1];
239 ex[0] =
s[2] - s_star[2];
246 ey[0] =
s[3] - s_star[3];
252 ey[0] =
s[4] - s_star[4];
266 std::cout <<
"Ellipse: " << std::endl;
268 std::cout <<
" x=" <<
s[0] << std::endl;
271 std::cout <<
" y=" <<
s[1] << std::endl;
273 std::cout <<
" n20=" <<
s[2] << std::endl;
275 std::cout <<
" n11=" <<
s[3] << std::endl;
277 std::cout <<
" n02=" <<
s[4] << std::endl;
278 std::cout <<
"A = " << A <<
" B = " << B <<
" C = " << C << std::endl;
289 for (
int i = 0; i < 5; i++)
294 double n02,
double a,
double b,
double c)
326 for (
int i = 0; i < 2; i++)
350 for (
int i = 2; i < 5; i++)
354 #if defined(VISP_BUILD_DEPRECATED_FUNCTIONS) 377 unsigned int thickness)
const 399 unsigned int thickness)
const 443 #if defined(VISP_BUILD_DEPRECATED_FUNCTIONS) void init()
Default initialization.
Implementation of a matrix and operations on matrices.
void buildFrom(double x, double y, double n20, double n11, double n02)
static vp_deprecated unsigned int selectMu11()
void resize(unsigned int nrows, unsigned int ncols, bool flagNullify=true, bool recopy_=true)
void print(unsigned int select=FEATURE_ALL) const
print the name of the feature
static unsigned int select_n02()
Class to define RGB colors available for display functionnalities.
void stack(const vpMatrix &A)
vpMatrix interaction(unsigned int select=FEATURE_ALL)
compute the interaction matrix from a subset a the possible features
unsigned int dim_s
Dimension of the visual feature.
static unsigned int selectY()
vpFeatureEllipse()
Default constructor.
static unsigned int select_n11()
class that defines what is a visual feature
static void displayEllipse(double x, double y, double n20, double n11, double n02, const vpCameraParameters &cam, const vpImage< unsigned char > &I, const vpColor &color=vpColor::green, unsigned int thickness=1)
static unsigned int select_n20()
vpFeatureEllipse * duplicate() const
Feature duplication.
static double sqr(double x)
void set_xy(double x, double y)
vp_deprecated void setMu(double mu20, double mu11, double mu02)
Generic class defining intrinsic camera parameters.
void setMoments(double n20, double n11, double n02)
void setABC(double A, double B, double C)
static vp_deprecated unsigned int selectMu20()
static const unsigned int FEATURE_LINE[32]
vpColVector error(const vpBasicFeature &s_star, unsigned int select=FEATURE_ALL)
void resize(unsigned int i, bool flagNullify=true)
vpBasicFeatureDeallocatorType deallocate
void display(const vpCameraParameters &cam, const vpImage< unsigned char > &I, const vpColor &color=vpColor::green, unsigned int thickness=1) const
static vp_deprecated unsigned int selectMu02()
Implementation of column vector and the associated operations.
static unsigned int selectX()
Class that defines 2D ellipse visual feature.
unsigned int nbParameters
Number of parameters needed to compute the interaction matrix.
vpColVector s
State of the visual feature.