39#include <visp3/visual_features/vpBasicFeature.h>
40#include <visp3/visual_features/vpFeatureLine.h>
43#include <visp3/core/vpException.h>
44#include <visp3/visual_features/vpFeatureException.h>
47#include <visp3/core/vpDebug.h>
50#include <visp3/core/vpMath.h>
55#include <visp3/core/vpCameraParameters.h>
58#include <visp3/core/vpColor.h>
59#include <visp3/core/vpImage.h>
61#include <visp3/core/vpFeatureDisplay.h>
107 for (
int i = 0; i < 2; i++)
192 if (
flags[i] ==
false) {
195 vpTRACE(
"Warning !!! The interaction matrix is computed but rho "
199 vpTRACE(
"Warning !!! The interaction matrix is computed but theta "
203 vpTRACE(
"Warning !!! The interaction matrix is computed but A was "
207 vpTRACE(
"Warning !!! The interaction matrix is computed but B was "
211 vpTRACE(
"Warning !!! The interaction matrix is computed but C was "
215 vpTRACE(
"Warning !!! The interaction matrix is computed but D was "
219 vpTRACE(
"Problem during the reading of the variable flags");
228 double co = cos(theta);
229 double si = sin(theta);
231 if (fabs(D) < 1e-6) {
232 vpERROR_TRACE(
"Incorrect plane coordinates D is null, D = %f", D);
237 double lambda_theta = (A * si - B * co) / D;
238 double lambda_rho = (C + rho * A * co + rho * B * si) / D;
243 Lrho[0][0] = co * lambda_rho;
244 Lrho[0][1] = si * lambda_rho;
245 Lrho[0][2] = -rho * lambda_rho;
246 Lrho[0][3] = si * (1.0 + rho * rho);
247 Lrho[0][4] = -co * (1.0 + rho * rho);
256 Ltheta[0][0] = co * lambda_theta;
257 Ltheta[0][1] = si * lambda_theta;
258 Ltheta[0][2] = -rho * lambda_theta;
259 Ltheta[0][3] = -rho * co;
260 Ltheta[0][4] = -rho * si;
313 erho[0] =
s[0] - s_star[0];
320 double err =
s[1] - s_star[1];
361 std::cout <<
"Line:\t " << A <<
"X+" << B <<
"Y+" << C <<
"Z +" << D <<
"=0" << std::endl;
363 std::cout <<
" \trho=" <<
s[0];
365 std::cout <<
" \ttheta=" <<
s[1];
366 std::cout << std::endl;
387 for (
int i = 0; i < 2; i++) {
462 unsigned int thickness)
const
489 unsigned int thickness)
const
vpColVector s
State of the visual feature.
unsigned int nbParameters
Number of parameters needed to compute the interaction matrix.
unsigned int dim_s
Dimension of the visual feature.
static const unsigned int FEATURE_LINE[32]
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)
static unsigned int selectRho()
vpMatrix interaction(unsigned int select=FEATURE_ALL) VP_OVERRIDE
vpFeatureLine & buildFrom(const double &rho, const double &theta)
vpFeatureLine * duplicate() const VP_OVERRIDE
void setABCD(double A, double B, double C, double D)
static unsigned int selectTheta()
void print(unsigned int select=FEATURE_ALL) const VP_OVERRIDE
void display(const vpCameraParameters &cam, const vpImage< unsigned char > &I, const vpColor &color=vpColor::green, unsigned int thickness=1) const VP_OVERRIDE
vpColVector error(const vpBasicFeature &s_star, unsigned int select=FEATURE_ALL) VP_OVERRIDE
Definition of the vpImage class member functions.
Implementation of a matrix and operations on matrices.
void stack(const vpMatrix &A)