39 #ifndef VP_FEATURE_SEGMENT_H
40 #define VP_FEATURE_SEGMENT_H
42 #include <visp3/core/vpConfig.h>
43 #include <visp3/core/vpDebug.h>
44 #include <visp3/core/vpMatrix.h>
45 #include <visp3/core/vpPoint.h>
46 #include <visp3/core/vpRGBa.h>
47 #include <visp3/visual_features/vpBasicFeature.h>
48 #include <visp3/visual_features/vpFeatureException.h>
74 vpFeatureSegment &buildFrom(
const double &x1,
const double &y1,
const double &Z1,
const double &x2,
const double &y2,
const double &Z2);
77 unsigned int thickness = 1)
const VP_OVERRIDE;
79 unsigned int thickness = 1)
const VP_OVERRIDE;
92 inline double getXc()
const {
return s[0]; }
100 inline double getYc()
const {
return s[1]; }
108 inline double getL()
const {
return s[2]; }
124 inline double getZ1()
const {
return Z1_; }
133 inline double getZ2()
const {
return Z2_; }
136 void init() VP_OVERRIDE;
139 vpMatrix interaction(
unsigned int select = FEATURE_ALL) VP_OVERRIDE;
141 void print(
unsigned int select = FEATURE_ALL) const VP_OVERRIDE;
146 bool isNormalized() {
return normalized_; };
148 static unsigned int selectXc();
149 static unsigned int selectYc();
150 static unsigned int selectL();
151 static unsigned int selectAlpha();
233 vpERROR_TRACE(
"Point is behind the camera ");
234 std::cout <<
"Z1 = " << Z1_ << std::endl;
239 if (fabs(Z1_) < 1e-6) {
240 vpERROR_TRACE(
"Point Z1 coordinates is null ");
241 std::cout <<
"Z1 = " << Z1_ << std::endl;
265 vpERROR_TRACE(
"Point Z2 is behind the camera ");
266 std::cout <<
"Z2 = " << Z2_ << std::endl;
271 if (fabs(Z2_) < 1e-6) {
272 vpERROR_TRACE(
"Point Z2 coordinates is null ");
273 std::cout <<
"Z2 = " << Z2_ << std::endl;
class that defines what is a visual feature
virtual vpColVector error(const vpBasicFeature &s_star, unsigned int select=FEATURE_ALL)
virtual void display(const vpCameraParameters &cam, const vpImage< unsigned char > &I, const vpColor &color=vpColor::green, unsigned int thickness=1) const =0
virtual vpBasicFeature * duplicate() const =0
Generic class defining intrinsic camera parameters.
Implementation of column vector and the associated operations.
Class to define RGB colors available for display functionalities.
static const vpColor green
Error that can be emitted by the vpBasicFeature class and its derivates.
@ badInitializationError
Wrong feature initialization.
Class that defines a 2D segment visual features. This class allow to consider two sets of visual feat...
void setAlpha(double val)
void setNormalized(bool normalized)
Implementation of a matrix and operations on matrices.