41#include <visp3/visual_features/vpBasicFeature.h>
42#include <visp3/visual_features/vpFeatureEllipse.h>
45#include <visp3/core/vpException.h>
46#include <visp3/visual_features/vpFeatureException.h>
49#include <visp3/core/vpDebug.h>
52#include <visp3/core/vpMath.h>
54#include <visp3/core/vpFeatureDisplay.h>
94 if (
flags[i] ==
false) {
97 vpTRACE(
"Warning !!! The interaction matrix is computed but x was "
101 vpTRACE(
"Warning !!! The interaction matrix is computed but y was "
105 vpTRACE(
"Warning !!! The interaction matrix is computed but n20 "
109 vpTRACE(
"Warning !!! The interaction matrix is computed but n11 "
113 vpTRACE(
"Warning !!! The interaction matrix is computed but n02 "
117 vpTRACE(
"Warning !!! The interaction matrix is computed but A was "
121 vpTRACE(
"Warning !!! The interaction matrix is computed but B was "
125 vpTRACE(
"Warning !!! The interaction matrix is computed but C was "
129 vpTRACE(
"Problem during the reading of the variable flags");
142 double Zinv = A * xc + B * yc + C;
150 H[0][2] = xc * Zinv + 4.0 * (A * n20 + B * n11);
151 H[0][3] = xc * yc + 4.0 * n11;
164 H[0][2] = yc * Zinv + 4.0 * (A * n11 + B * n02);
166 H[0][4] = -xc * yc - 4.0 * n11;
176 H[0][0] = -2.0 * (A * n20 + B * n11);
178 H[0][2] = 2 * ((Zinv + A * xc) * n20 + B * xc * n11);
179 H[0][3] = 2 * (yc * n20 + xc * n11);
180 H[0][4] = -4 * n20 * xc;
190 H[0][0] = -A * n11 - B * n02;
191 H[0][1] = -A * n20 - B * n11;
192 H[0][2] = A * yc * n20 + (3 * Zinv - C) * n11 + B * xc * n02;
193 H[0][3] = 3 * yc * n11 + xc * n02;
194 H[0][4] = -yc * n20 - 3 * xc * n11;
205 H[0][1] = -2 * (A * n11 + B * n02);
206 H[0][2] = 2 * ((Zinv + B * yc) * n02 + A * yc * n11);
207 H[0][3] = 4 * yc * n02;
208 H[0][4] = -2 * (yc * n11 + xc * n02);
225 ex[0] =
s[0] - s_star[0];
232 ey[0] =
s[1] - s_star[1];
238 ex[0] =
s[2] - s_star[2];
245 ey[0] =
s[3] - s_star[3];
251 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++)
325 for (
int i = 0; i < 2; i++)
349 for (
int i = 2; i < 5; i++)
353#if defined(VISP_BUILD_DEPRECATED_FUNCTIONS)
373 unsigned int thickness)
const
395 unsigned int thickness)
const
439#if defined(VISP_BUILD_DEPRECATED_FUNCTIONS)
void resize(unsigned int nrows, unsigned int ncols, bool flagNullify=true, bool recopy_=true)
vpColVector s
State of the visual feature.
static const unsigned int FEATURE_LINE[32]
unsigned int nbParameters
Number of parameters needed to compute the interaction matrix.
unsigned int dim_s
Dimension of the visual feature.
vpBasicFeatureDeallocatorType deallocate
Generic class defining intrinsic camera parameters.
Implementation of column vector and the associated operations.
Class to define RGB colors available for display functionalities.
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)
void print(unsigned int select=FEATURE_ALL) const
print the name of the feature
vpFeatureEllipse * duplicate() const
Feature duplication.
static unsigned int selectX()
void init()
Default initialization.
vpFeatureEllipse()
Default constructor.
static unsigned int selectY()
void setABC(double A, double B, double C)
vp_deprecated void setMu(double mu20, double mu11, double mu02)
vpMatrix interaction(unsigned int select=FEATURE_ALL)
compute the interaction matrix from a subset a the possible features
static unsigned int select_n20()
void setMoments(double n20, double n11, double n02)
void display(const vpCameraParameters &cam, const vpImage< unsigned char > &I, const vpColor &color=vpColor::green, unsigned int thickness=1) const
vpColVector error(const vpBasicFeature &s_star, unsigned int select=FEATURE_ALL)
static unsigned int select_n02()
static vp_deprecated unsigned int selectMu20()
static unsigned int select_n11()
void set_xy(double x, double y)
static vp_deprecated unsigned int selectMu11()
static vp_deprecated unsigned int selectMu02()
void buildFrom(double x, double y, double n20, double n11, double n02)
Definition of the vpImage class member functions.
static double sqr(double x)
Implementation of a matrix and operations on matrices.
void stack(const vpMatrix &A)