ViSP
2.10.0
|
#include <vpFeatureSegment.h>
Public Types | |
enum | vpBasicFeatureDeallocatorType { user, vpServo } |
Public Member Functions | |
vpFeatureSegment (bool normalized=false) | |
~vpFeatureSegment () | |
void | buildFrom (const double x1, const double y1, const double Z1, const double x2, const double y2, const double Z2) |
void | display (const vpCameraParameters &cam, const vpImage< unsigned char > &I, const vpColor &color=vpColor::green, unsigned int thickness=1) const |
void | display (const vpCameraParameters &cam, const vpImage< vpRGBa > &I, const vpColor &color=vpColor::green, unsigned int thickness=1) const |
vpFeatureSegment * | duplicate () const |
vpColVector | error (const vpBasicFeature &s_star, const unsigned int select=FEATURE_ALL) |
double | getXc () const |
double | getYc () const |
double | getL () const |
double | getAlpha () const |
double | getZ1 () const |
double | getZ2 () const |
void | init () |
vpMatrix | interaction (const unsigned int select=FEATURE_ALL) |
void | print (const unsigned int select=FEATURE_ALL) const |
bool | isNormalized () |
void | setNormalized (bool normalized) |
void | setXc (const double val) |
void | setYc (const double val) |
void | setL (const double val) |
void | setAlpha (const double val) |
void | setZ1 (const double val) |
void | setZ2 (const double val) |
unsigned int | dimension_s () |
virtual double | operator[] (const unsigned int i) const |
vpColVector | get_s (unsigned int select=FEATURE_ALL) const |
unsigned int | getDimension (const unsigned int select=FEATURE_ALL) const |
void | setFlags () |
void | setDeallocate (vpBasicFeatureDeallocatorType d) |
vpBasicFeatureDeallocatorType | getDeallocate () |
Static Public Member Functions | |
static unsigned int | selectXc () |
static unsigned int | selectYc () |
static unsigned int | selectL () |
static unsigned int | selectAlpha () |
static unsigned int | selectAll () |
Static Public Attributes | |
static const unsigned int | FEATURE_LINE [32] |
static const unsigned int | FEATURE_ALL = 0xffff |
Protected Member Functions | |
void | resetFlags () |
Protected Attributes | |
vpColVector | s |
unsigned int | dim_s |
bool * | flags |
unsigned int | nbParameters |
vpBasicFeatureDeallocatorType | deallocate |
Class that defines a 2D segment visual features. This class allow to consider two sets of visual features:
The selection of the feature set is done either during construction using vpFeatureSegment(bool), or by setNormalized(bool).
Definition at line 76 of file vpFeatureSegment.h.
|
inherited |
Indicates who should deallocate the feature.
Enumerator | |
---|---|
user | |
vpServo |
Definition at line 154 of file vpBasicFeature.h.
vpFeatureSegment::vpFeatureSegment | ( | bool | normalized = false | ) |
Default constructor that builds an empty segment visual feature.
normalized | : If true, use normalized features . If false, use non normalized features . |
Definition at line 91 of file vpFeatureSegment.cpp.
References init().
Referenced by duplicate().
|
inline |
Destructor. Does nothing.
Definition at line 83 of file vpFeatureSegment.h.
void vpFeatureSegment::buildFrom | ( | const double | x1, |
const double | y1, | ||
const double | Z1, | ||
const double | x2, | ||
const double | y2, | ||
const double | Z2 | ||
) |
Build a segment visual feature from two points and their Z coordinates.
x1,y1 | : coordinates of the first point in the image plane. |
Z1 | : depth of the first point in the camera frame. |
x2,y2 | : coordinates of the second point in the image plane. |
Z2 | : depth of the second point in the camera frame. |
Depending on the feature set that is considered, the features or are computed from the two points using the following formulae:
Definition at line 580 of file vpFeatureSegment.cpp.
References setAlpha(), setL(), setXc(), setYc(), setZ1(), and setZ2().
Referenced by vpFeatureBuilder::create().
|
inlineinherited |
Return the dimension of the feature vector .
Definition at line 102 of file vpBasicFeature.h.
|
virtual |
Displays a segment representing the feature on a greyscale image. The two limiting points are displayed in cyan and yellow.
cam | : Camera parameters. |
I | : Image. |
color | : Color to use for the segment. |
thickness | : Thickness of the feature representation. |
Implements vpBasicFeature.
Definition at line 489 of file vpFeatureSegment.cpp.
References vpMeterPixelConversion::convertPoint(), vpDisplay::displayCircle(), vpDisplay::displayLine(), and vpColor::yellow.
|
virtual |
Displays a segment representing the feature on a RGBa image. The two limiting points are displayed in cyan and yellow.
cam | : Camera parameters. |
I | : Image. |
color | : Color to use for the segment. |
thickness | : Thickness of the feature representation. |
Implements vpBasicFeature.
Definition at line 531 of file vpFeatureSegment.cpp.
References vpMeterPixelConversion::convertPoint(), vpColor::cyan, vpDisplay::displayCircle(), vpDisplay::displayLine(), and vpColor::yellow.
|
virtual |
Feature duplication.
Create an object with the same type.
Implements vpBasicFeature.
Definition at line 469 of file vpFeatureSegment.cpp.
References vpFeatureSegment().
|
virtual |
Computes the error between the current and the desired visual features from a subset of the possible features or .
For the angular component , we define the error as , where is modulo substraction.
s_star | : Desired 2D segment feature. |
select | : The error can be computed for a selection of a subset of the possible segment features.
|
Reimplemented from vpBasicFeature.
Definition at line 370 of file vpFeatureSegment.cpp.
References selectAlpha(), selectL(), selectXc(), selectYc(), and vpMatrix::stackMatrices().
|
inherited |
Get the feature vector .
Definition at line 135 of file vpBasicFeature.cpp.
References vpBasicFeature::dim_s, vpBasicFeature::FEATURE_LINE, vpBasicFeature::s, and vpMatrix::stackMatrices().
Referenced by vpServo::computeError(), vpBasicFeature::error(), vpGenericFeature::error(), vpFeatureDepth::error(), vpFeatureThetaU::error(), and vpFeatureTranslation::error().
|
inline |
Get the value of which represents the orientation of the segment.
Definition at line 129 of file vpFeatureSegment.h.
|
inlineinherited |
Definition at line 164 of file vpBasicFeature.h.
|
inherited |
Get the feature vector dimension.
Definition at line 120 of file vpBasicFeature.cpp.
References vpBasicFeature::dim_s, vpBasicFeature::FEATURE_LINE, vpMatrix::getRows(), and vpBasicFeature::s.
|
inline |
Get the length of the segment.
Definition at line 122 of file vpFeatureSegment.h.
|
inline |
Get the x coordinate of the segment center in the image plane.
Definition at line 107 of file vpFeatureSegment.h.
|
inline |
Get the y coordinate of the segment center in the image plane.
Definition at line 114 of file vpFeatureSegment.h.
|
inline |
Get the value of which represents the Z coordinate in the camera frame of the 3D point that corresponds to the segment first point.
Definition at line 137 of file vpFeatureSegment.h.
|
inline |
Get the value of which represents the Z coordinate in the camera frame of the 3D point that corresponds to the segment second point.
Definition at line 145 of file vpFeatureSegment.h.
|
virtual |
Initialise the memory space requested for segment visual feature.
Implements vpBasicFeature.
Definition at line 72 of file vpFeatureSegment.cpp.
References vpBasicFeature::dim_s, vpBasicFeature::flags, vpBasicFeature::nbParameters, vpColVector::resize(), and vpBasicFeature::s.
Referenced by vpFeatureSegment().
|
virtual |
Compute and return the interaction matrix associated to a subset of the possible features or .
The interaction matrix of the non normalized feature set is of the following form:
with and where are the depths of the points.
select | : Selection of a subset of the possible segment features.
|
The code below shows how to compute the interaction matrix associated to the visual feature .
In this case, L is a 4 by 6 matrix.
It is also possible to build the interaction matrix associated to one of the possible features. The code below shows how to modify the previous code to consider as visual feature .
In that case, L is a 2 by 6 matrix.
Implements vpBasicFeature.
Definition at line 196 of file vpFeatureSegment.cpp.
References vpBasicFeature::deallocate, vpBasicFeature::flags, vpBasicFeature::nbParameters, vpMatrix::resize(), selectAlpha(), selectL(), selectXc(), selectYc(), vpMatrix::stackMatrices(), vpBasicFeature::user, and vpTRACE.
|
inline |
Indicates if the normalized features are considered.
Definition at line 158 of file vpFeatureSegment.h.
Referenced by vpFeatureBuilder::create().
|
inlinevirtualinherited |
Return element i in the state vector (usage : x = s[i] )
Definition at line 113 of file vpBasicFeature.h.
|
virtual |
Print to stdout the values of the current visual feature .
select | : Selection of a subset of the possible segement features ( , , , ). |
produces the following output:
while
produces the following output:
Implements vpBasicFeature.
Definition at line 429 of file vpFeatureSegment.cpp.
References vpMath::deg(), vpBasicFeature::s, selectAlpha(), selectL(), selectXc(), and selectYc().
|
protectedinherited |
Definition at line 153 of file vpBasicFeature.cpp.
References vpBasicFeature::flags, and vpBasicFeature::nbParameters.
Referenced by vpFeatureEllipse::interaction(), vpFeatureVanishingPoint::interaction(), vpFeatureDepth::interaction(), vpFeaturePoint::interaction(), vpFeatureLine::interaction(), vpFeaturePoint3D::interaction(), vpFeaturePointPolar::interaction(), vpFeatureThetaU::interaction(), and vpFeatureTranslation::interaction().
|
inlinestaticinherited |
Select all the features.
Definition at line 116 of file vpBasicFeature.h.
|
inlinestatic |
Function used to select the subfeature.
This function is to use in conjunction with interaction() in order to compute the interaction matrix associated to feature.
See the interaction() method for an usage example.
This function is also useful in the vpServo class to indicate that a subset of the visual feature is to use in the control law:
Definition at line 257 of file vpFeatureSegment.h.
Referenced by error(), interaction(), and print().
|
inlinestatic |
Function used to select the or subfeature.
This function is to use in conjunction with interaction() in order to compute the interaction matrix associated to or feature.
See the interaction() method for an usage example.
This function is also useful in the vpServo class to indicate that a subset of the visual feature is to use in the control law:
Definition at line 232 of file vpFeatureSegment.h.
Referenced by error(), interaction(), and print().
|
inlinestatic |
Function used to select the or subfeature.
This function is to use in conjunction with interaction() in order to compute the interaction matrix associated to or feature.
See the interaction() method for an usage example.
This function is also useful in the vpServo class to indicate that a subset of the visual feature is to use in the control law:
Definition at line 182 of file vpFeatureSegment.h.
Referenced by error(), interaction(), and print().
|
inlinestatic |
Function used to select the or subfeature.
This function is to use in conjunction with interaction() in order to compute the interaction matrix associated to or feature.
See the interaction() method for an usage example.
This function is also useful in the vpServo class to indicate that a subset of the visual feature is to use in the control law:
Definition at line 207 of file vpFeatureSegment.h.
Referenced by error(), interaction(), and print().
|
inline |
Set the value of which represents the orientation of the segment in the image plane. It is one parameter of the visual feature .
val | : value to set. |
Definition at line 307 of file vpFeatureSegment.h.
Referenced by buildFrom(), and vpFeatureBuilder::create().
|
inlineinherited |
Definition at line 163 of file vpBasicFeature.h.
Referenced by vpServo::addFeature().
|
inherited |
Set feature flags to true to prevent warning when re-computing the interaction matrix without having updated the feature.
Definition at line 163 of file vpBasicFeature.cpp.
References vpBasicFeature::flags, and vpBasicFeature::nbParameters.
|
inline |
Set the value of the segment length in the image plane. It is one parameter of the visual feature .
val | : Value to set, that is either equal to when normalized features are considered, or equal to otherwise. |
Definition at line 296 of file vpFeatureSegment.h.
Referenced by buildFrom(), and vpFeatureBuilder::create().
|
inline |
Set the king of feature to consider.
normalized | : If true, use normalized features . If false, use non normalized features . |
Definition at line 264 of file vpFeatureSegment.h.
|
inline |
Set the value of the x coordinate of the segment center in the image plane. It is one parameter of the visual feature .
val | : Value to set, that is either equal to when normalized features are considered, or equal to otherwise. |
Definition at line 273 of file vpFeatureSegment.h.
Referenced by buildFrom(), and vpFeatureBuilder::create().
|
inline |
Set the value of the y coordinate of the segment center in the image plane. It is one parameter of the visual feature .
val | : Value to set, that is either equal to when normalized features are considered, or equal to otherwise. |
Definition at line 285 of file vpFeatureSegment.h.
Referenced by buildFrom(), and vpFeatureBuilder::create().
|
inline |
Set the value of which represents the Z coordinate in the camera frame of the 3D point that corresponds to the segment first point.
This value is requested to compute the interaction matrix.
val | : value to set. |
vpFeatureException::badInitializationError | : If Z1 is behind the camera or equal to zero. |
Definition at line 325 of file vpFeatureSegment.h.
References vpFeatureException::badInitializationError, and vpERROR_TRACE.
Referenced by buildFrom().
|
inline |
Set the value of which represents the Z coordinate in the camera frame of the 3D point that corresponds to the segment second point.
This value is requested to compute the interaction matrix.
val | : value to set. |
vpFeatureException::badInitializationError | : If Z2 is behind the camera or equal to zero. |
Definition at line 361 of file vpFeatureSegment.h.
References vpFeatureException::badInitializationError, and vpERROR_TRACE.
Referenced by buildFrom().
|
protectedinherited |
Definition at line 161 of file vpBasicFeature.h.
Referenced by vpFeatureEllipse::interaction(), vpFeatureVanishingPoint::interaction(), interaction(), vpFeatureDepth::interaction(), vpFeaturePoint::interaction(), vpFeatureLine::interaction(), vpFeaturePoint3D::interaction(), vpFeaturePointPolar::interaction(), vpFeatureThetaU::interaction(), vpFeatureTranslation::interaction(), and vpBasicFeature::operator=().
|
protectedinherited |
Dimension of the visual feature.
Definition at line 93 of file vpBasicFeature.h.
Referenced by vpFeatureMoment::duplicate(), vpGenericFeature::duplicate(), vpBasicFeature::error(), vpFeatureLuminance::error(), vpGenericFeature::error(), vpBasicFeature::get_s(), vpGenericFeature::get_s(), vpBasicFeature::getDimension(), vpFeatureMoment::getDimension(), vpFeatureEllipse::init(), vpFeatureVanishingPoint::init(), vpFeatureLuminance::init(), init(), vpFeatureDepth::init(), vpFeatureMoment::init(), vpFeaturePoint::init(), vpFeatureLine::init(), vpFeaturePoint3D::init(), vpFeatureThetaU::init(), vpFeaturePointPolar::init(), vpFeatureTranslation::init(), vpFeatureLuminance::interaction(), vpGenericFeature::interaction(), vpFeatureMoment::interaction(), vpBasicFeature::operator=(), vpFeatureLuminance::operator=(), vpGenericFeature::print(), vpFeatureMoment::print(), vpGenericFeature::set_s(), vpGenericFeature::setError(), vpGenericFeature::setInteractionMatrix(), vpFeatureMoment::update(), vpFeatureLuminance::vpFeatureLuminance(), and vpGenericFeature::vpGenericFeature().
|
staticinherited |
Definition at line 87 of file vpBasicFeature.h.
Referenced by vpFeatureDepth::error(), vpFeatureDepth::interaction(), and vpFeatureDepth::print().
|
staticinherited |
Definition at line 85 of file vpBasicFeature.h.
Referenced by vpBasicFeature::error(), vpGenericFeature::error(), vpBasicFeature::get_s(), vpBasicFeature::getDimension(), vpFeatureMoment::getDimension(), vpGenericFeature::interaction(), vpFeatureMoment::interaction(), vpGenericFeature::print(), and vpFeatureMoment::print().
|
protectedinherited |
Ensure that all the parameters needed to compute the iteraction matrix are set.
Definition at line 96 of file vpBasicFeature.h.
Referenced by vpFeatureEllipse::buildFrom(), vpFeatureVanishingPoint::buildFrom(), vpFeatureDepth::buildFrom(), vpFeaturePoint::buildFrom(), vpFeatureLine::buildFrom(), vpFeaturePoint3D::buildFrom(), vpFeatureThetaU::buildFrom(), vpFeaturePointPolar::buildFrom(), vpFeatureTranslation::buildFrom(), vpFeatureMoment::duplicate(), vpFeatureEllipse::init(), vpFeatureVanishingPoint::init(), vpFeatureLuminance::init(), init(), vpFeatureDepth::init(), vpFeatureMoment::init(), vpFeaturePoint::init(), vpFeatureLine::init(), vpFeaturePoint3D::init(), vpFeatureThetaU::init(), vpFeaturePointPolar::init(), vpFeatureTranslation::init(), vpFeatureEllipse::interaction(), vpFeatureVanishingPoint::interaction(), interaction(), vpFeatureDepth::interaction(), vpFeaturePoint::interaction(), vpFeatureLine::interaction(), vpFeaturePoint3D::interaction(), vpFeaturePointPolar::interaction(), vpFeatureThetaU::interaction(), vpFeatureTranslation::interaction(), vpBasicFeature::operator=(), vpBasicFeature::resetFlags(), vpFeaturePointPolar::set_rho(), vpFeaturePointPolar::set_rhoThetaZ(), vpFeaturePointPolar::set_theta(), vpFeatureThetaU::set_TUx(), vpFeatureThetaU::set_TUy(), vpFeatureThetaU::set_TUz(), vpFeatureEllipse::set_x(), vpFeatureVanishingPoint::set_x(), vpFeatureDepth::set_x(), vpFeaturePoint::set_x(), vpFeaturePoint3D::set_X(), vpFeatureEllipse::set_xy(), vpFeaturePoint::set_xyZ(), vpFeaturePoint3D::set_XYZ(), vpFeatureDepth::set_xyZLogZoverZstar(), vpFeatureEllipse::set_y(), vpFeatureVanishingPoint::set_y(), vpFeatureDepth::set_y(), vpFeaturePoint::set_y(), vpFeaturePoint3D::set_Y(), vpFeatureLuminance::set_Z(), vpFeatureDepth::set_Z(), vpFeaturePoint::set_Z(), vpFeaturePoint3D::set_Z(), vpFeaturePointPolar::set_Z(), vpFeatureEllipse::setABC(), vpFeatureLine::setABCD(), vpBasicFeature::setFlags(), vpFeatureEllipse::setMu(), vpFeatureLine::setRhoTheta(), vpFeatureMoment::update(), vpFeatureLuminance::vpFeatureLuminance(), and vpBasicFeature::~vpBasicFeature().
|
protectedinherited |
Number of parameters needed to compute the interaction matrix.
Definition at line 98 of file vpBasicFeature.h.
Referenced by vpFeatureEllipse::buildFrom(), vpFeatureVanishingPoint::buildFrom(), vpFeatureDepth::buildFrom(), vpFeaturePoint::buildFrom(), vpFeatureLine::buildFrom(), vpFeaturePoint3D::buildFrom(), vpFeatureThetaU::buildFrom(), vpFeaturePointPolar::buildFrom(), vpFeatureMoment::duplicate(), vpFeatureEllipse::init(), vpFeatureVanishingPoint::init(), vpFeatureLuminance::init(), init(), vpFeatureDepth::init(), vpFeatureMoment::init(), vpFeaturePoint::init(), vpFeatureLine::init(), vpFeaturePoint3D::init(), vpFeatureThetaU::init(), vpFeaturePointPolar::init(), vpFeatureTranslation::init(), vpFeatureEllipse::interaction(), vpFeatureVanishingPoint::interaction(), interaction(), vpFeatureDepth::interaction(), vpFeaturePoint::interaction(), vpFeatureLine::interaction(), vpFeaturePoint3D::interaction(), vpFeaturePointPolar::interaction(), vpFeatureThetaU::interaction(), vpFeatureTranslation::interaction(), vpBasicFeature::operator=(), vpBasicFeature::resetFlags(), vpFeaturePointPolar::set_rhoThetaZ(), vpFeaturePoint::set_xyZ(), vpFeaturePoint3D::set_XYZ(), vpFeatureDepth::set_xyZLogZoverZstar(), vpFeatureEllipse::setABC(), vpFeatureLine::setABCD(), vpBasicFeature::setFlags(), vpFeatureMoment::update(), and vpFeatureLuminance::vpFeatureLuminance().
|
protectedinherited |
State of the visual feature.
Definition at line 91 of file vpBasicFeature.h.
Referenced by vpFeatureEllipse::buildFrom(), vpFeatureLuminance::buildFrom(), vpFeatureVanishingPoint::buildFrom(), vpFeatureDepth::buildFrom(), vpFeaturePoint::buildFrom(), vpFeatureLine::buildFrom(), vpFeaturePoint3D::buildFrom(), vpFeatureThetaU::buildFrom(), vpFeaturePointPolar::buildFrom(), vpFeatureTranslation::buildFrom(), vpFeatureEllipse::display(), vpFeatureMoment::duplicate(), vpBasicFeature::error(), vpFeatureEllipse::error(), vpFeatureVanishingPoint::error(), vpFeatureLuminance::error(), vpFeatureMomentAlpha::error(), vpGenericFeature::error(), vpFeatureDepth::error(), vpFeaturePoint::error(), vpFeatureLine::error(), vpFeaturePoint3D::error(), vpFeaturePointPolar::error(), vpFeatureThetaU::error(), vpFeatureTranslation::error(), vpFeatureDepth::get_LogZoverZstar(), vpFeaturePointPolar::get_rho(), vpBasicFeature::get_s(), vpGenericFeature::get_s(), vpFeaturePointPolar::get_theta(), vpFeatureThetaU::get_TUx(), vpFeatureThetaU::get_TUy(), vpFeatureThetaU::get_TUz(), vpFeatureTranslation::get_Tx(), vpFeatureTranslation::get_Ty(), vpFeatureTranslation::get_Tz(), vpFeatureVanishingPoint::get_x(), vpFeaturePoint::get_x(), vpFeaturePoint3D::get_X(), vpFeatureVanishingPoint::get_y(), vpFeaturePoint::get_y(), vpFeaturePoint3D::get_Y(), vpFeaturePoint3D::get_Z(), vpBasicFeature::getDimension(), vpFeatureEllipse::init(), vpFeatureVanishingPoint::init(), vpFeatureLuminance::init(), init(), vpFeatureDepth::init(), vpGenericFeature::init(), vpFeatureMoment::init(), vpFeaturePoint::init(), vpFeatureLine::init(), vpFeaturePoint3D::init(), vpFeatureThetaU::init(), vpFeaturePointPolar::init(), vpFeatureTranslation::init(), vpFeatureEllipse::interaction(), vpFeatureLine::interaction(), vpFeatureThetaU::interaction(), vpFeatureTranslation::interaction(), vpBasicFeature::operator=(), vpFeatureEllipse::print(), print(), vpGenericFeature::print(), vpFeatureMoment::print(), vpFeatureLine::print(), vpFeatureThetaU::print(), vpFeatureTranslation::print(), vpFeatureDepth::set_LogZoverZstar(), vpFeaturePointPolar::set_rho(), vpGenericFeature::set_s(), vpFeaturePointPolar::set_theta(), vpFeatureThetaU::set_TUx(), vpFeatureThetaU::set_TUy(), vpFeatureThetaU::set_TUz(), vpFeatureTranslation::set_Tx(), vpFeatureTranslation::set_Ty(), vpFeatureTranslation::set_Tz(), vpFeatureEllipse::set_x(), vpFeatureVanishingPoint::set_x(), vpFeaturePoint::set_x(), vpFeaturePoint3D::set_X(), vpFeatureEllipse::set_xy(), vpFeatureEllipse::set_y(), vpFeatureVanishingPoint::set_y(), vpFeaturePoint::set_y(), vpFeaturePoint3D::set_Y(), vpFeaturePoint3D::set_Z(), vpFeatureEllipse::setMu(), vpFeatureLine::setRhoTheta(), vpFeatureMoment::update(), and vpGenericFeature::vpGenericFeature().