41#include <visp3/visual_features/vpBasicFeature.h>
42#include <visp3/visual_features/vpFeatureLine.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>
57#include <visp3/core/vpCameraParameters.h>
60#include <visp3/core/vpColor.h>
61#include <visp3/core/vpImage.h>
63#include <visp3/core/vpFeatureDisplay.h>
108 for (
int i = 0; i < 2; i++)
193 if (
flags[i] ==
false) {
196 vpTRACE(
"Warning !!! The interaction matrix is computed but rho "
200 vpTRACE(
"Warning !!! The interaction matrix is computed but theta "
204 vpTRACE(
"Warning !!! The interaction matrix is computed but A was "
208 vpTRACE(
"Warning !!! The interaction matrix is computed but B was "
212 vpTRACE(
"Warning !!! The interaction matrix is computed but C was "
216 vpTRACE(
"Warning !!! The interaction matrix is computed but D was "
220 vpTRACE(
"Problem during the reading of the variable flags");
229 double co = cos(theta);
230 double si = sin(theta);
232 if (fabs(D) < 1e-6) {
233 vpERROR_TRACE(
"Incorrect plane coordinates D is null, D = %f", D);
238 double lambda_theta = (A * si - B * co) / D;
239 double lambda_rho = (C + rho * A * co + rho * B * si) / D;
244 Lrho[0][0] = co * lambda_rho;
245 Lrho[0][1] = si * lambda_rho;
246 Lrho[0][2] = -rho * lambda_rho;
247 Lrho[0][3] = si * (1.0 + rho * rho);
248 Lrho[0][4] = -co * (1.0 + rho * rho);
257 Ltheta[0][0] = co * lambda_theta;
258 Ltheta[0][1] = si * lambda_theta;
259 Ltheta[0][2] = -rho * lambda_theta;
260 Ltheta[0][3] = -rho * co;
261 Ltheta[0][4] = -rho * si;
314 erho[0] =
s[0] - s_star[0];
321 double err =
s[1] - s_star[1];
361 std::cout <<
"Line:\t " << A <<
"X+" << B <<
"Y+" << C <<
"Z +" << D <<
"=0" << std::endl;
364 std::cout <<
" \trho=" <<
s[0];
366 std::cout <<
" \ttheta=" <<
s[1];
367 std::cout << std::endl;
388 for (
int i = 0; i < 2; i++)
459 unsigned int thickness)
const
485 unsigned int thickness)
const
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 displayLine(double rho, double theta, const vpCameraParameters &cam, const vpImage< unsigned char > &I, const vpColor &color=vpColor::green, unsigned int thickness=1)
Error that can be emitted by the vpBasicFeature class and its derivates.
@ badInitializationError
Wrong feature initialization.
void setRhoTheta(double rho, double theta)
void display(const vpCameraParameters &cam, const vpImage< unsigned char > &I, const vpColor &color=vpColor::green, unsigned int thickness=1) const
static unsigned int selectRho()
vpFeatureLine * duplicate() const
void buildFrom(double rho, double theta)
void print(unsigned int select=FEATURE_ALL) const
void setABCD(double A, double B, double C, double D)
static unsigned int selectTheta()
vpMatrix interaction(unsigned int select=FEATURE_ALL)
vpColVector error(const vpBasicFeature &s_star, unsigned int select=FEATURE_ALL)
Definition of the vpImage class member functions.
Implementation of a matrix and operations on matrices.
void stack(const vpMatrix &A)