52 #include <visp/vpMatrix.h>
53 #include <visp/vpMath.h>
54 #include <visp/vpColVector.h>
55 #include <visp/vpPoint.h>
56 #include <visp/vpPose.h>
57 #include <visp/vpDisplay.h>
58 #include <visp/vpDisplayOpenCV.h>
59 #include <visp/vpDisplayX.h>
60 #include <visp/vpDisplayGDI.h>
61 #include <visp/vpPixelMeterConversion.h>
62 #include <visp/vpCameraParameters.h>
63 #include <visp/vpColor.h>
64 #include <visp/vpIoTools.h>
65 #include <visp/vpException.h>
66 #include <visp/vpImageIo.h>
67 #include <visp/vpMbTracker.h>
68 #include <visp/vpMatrixException.h>
69 #include <visp/vpIoTools.h>
74 #include <Inventor/nodes/SoSeparator.h>
75 #include <Inventor/VRMLnodes/SoVRMLIndexedFaceSet.h>
76 #include <Inventor/VRMLnodes/SoVRMLIndexedLineSet.h>
77 #include <Inventor/VRMLnodes/SoVRMLCoordinate.h>
78 #include <Inventor/actions/SoWriteAction.h>
79 #include <Inventor/actions/SoSearchAction.h>
80 #include <Inventor/misc/SoChildList.h>
81 #include <Inventor/actions/SoGetMatrixAction.h>
82 #include <Inventor/actions/SoGetPrimitiveCountAction.h>
83 #include <Inventor/actions/SoToVRML2Action.h>
84 #include <Inventor/VRMLnodes/SoVRMLGroup.h>
85 #include <Inventor/VRMLnodes/SoVRMLTransform.h>
86 #include <Inventor/VRMLnodes/SoVRMLShape.h>
96 : cam(), cMo(), modelFileName(), modelInitialised(false),
97 poseSavingFilename(), computeCovariance(false), covarianceMatrix(), displayFeatures(false)
138 std::string ext =
".init";
139 std::string str_pose =
"";
140 size_t pos = (
unsigned int)initFile.rfind(ext);
143 std::fstream finitpos ;
145 char s[FILENAME_MAX];
147 if( pos == initFile.size()-ext.size() && pos != 0)
148 str_pose = initFile.substr(0,pos) +
".0.pos";
150 str_pose = initFile +
".0.pos";
152 finitpos.open(str_pose.c_str() ,std::ios::in) ;
153 sprintf(s,
"%s", str_pose.c_str());
158 if(finitpos.fail() ){
159 std::cout <<
"cannot read " << s << std::endl <<
"cMo set to identity" << std::endl;
163 for (
unsigned int i = 0; i < 6; i += 1){
164 finitpos >> init_pos[i];
170 std::cout <<
"last_cMo : "<<std::endl << last_cMo <<std::endl;
177 std::cout <<
"No modification : left click " << std::endl;
178 std::cout <<
"Modify initial pose : right click " << std::endl ;
181 "left click to validate, right click to modify initial pose",
209 if( pos == initFile.size()-ext.size() && pos != 0)
210 sprintf(s,
"%s", initFile.c_str());
212 sprintf(s,
"%s.init", initFile.c_str());
214 std::cout <<
"filename " << s << std::endl ;
215 finit.open(s,std::ios::in) ;
217 std::cout <<
"cannot read " << s << std::endl;
222 if( pos == initFile.size()-ext.size() && pos != 0)
223 dispF = initFile.substr(0,pos) +
".ppm";
225 dispF = initFile +
".ppm";
227 sprintf(s,
"%s", dispF.c_str());
231 #if defined VISP_HAVE_X11
233 #elif defined VISP_HAVE_GDI
235 #elif defined VISP_HAVE_OPENCV
241 #if defined(VISP_HAVE_X11) || defined(VISP_HAVE_GDI) || defined(VISP_HAVE_OPENCV)
242 d.
init(Iref,10,500,
"Where to initialize...") ;
252 std::cout <<
"number of points " << n << std::endl ;
255 "Exceed the max number of points.");
259 for (
unsigned int i=0 ; i < n ; i++){
269 bool isWellInit =
false;
273 for(
unsigned int i=0 ; i< n ; i++)
275 std::cout <<
"Click on point " << i+1 << std::endl ;
284 std::cout <<
"click sur point " << ip << std::endl;
307 "left click to validate, right click to re initialize object",
339 std::cout <<
"cMo : "<<std::endl <<
cMo <<std::endl;
353 const std::string &displayFile)
360 for (
unsigned int i=0 ; i < points3D_list.size() ; i++)
361 P[i].setWorldCoordinates(points3D_list[i].get_oX(),points3D_list[i].get_oY(),points3D_list[i].get_oZ()) ;
365 #if defined VISP_HAVE_X11
367 #elif defined VISP_HAVE_GDI
369 #elif defined VISP_HAVE_OPENCV
373 if(displayFile !=
""){
375 std::cout << displayFile.c_str() << std::endl;
377 #if defined(VISP_HAVE_X11) || defined(VISP_HAVE_GDI) || defined(VISP_HAVE_OPENCV)
378 d.
init(Iref,10,500,
"Where to initialize...") ;
387 bool isWellInit =
false;
390 for(
unsigned int i=0 ; i< points3D_list.size() ; i++)
392 std::cout <<
"Click on point " << i+1 << std::endl ;
401 std::cout <<
"Click on point " << ip << std::endl;
424 "left click to validate, right click to re initialize object",
471 char s[FILENAME_MAX];
474 std::string ext =
".init";
475 size_t pos = initFile.rfind(ext);
477 if( pos == initFile.size()-ext.size() && pos != 0)
478 sprintf(s,
"%s", initFile.c_str());
480 sprintf(s,
"%s.init", initFile.c_str());
482 std::cout <<
"filename " << s << std::endl ;
483 finit.open(s,std::ios::in) ;
485 std::cout <<
"cannot read " << s << std::endl;
492 std::cout <<
"number of points " << size << std::endl ;
496 "Exceed the max number of points.");
502 for(
unsigned int i=0 ; i< size ; i++)
515 vpERROR_TRACE(
"vpMbTracker::initFromPoints(), Number of 2D points different to the number of 3D points." );
517 for(
unsigned int i=0 ; i< size ; i++)
555 const std::vector<vpPoint> &points3D_list )
557 if(points2D_list.size() != points3D_list.size())
558 vpERROR_TRACE(
"vpMbTracker::initFromPoints(), Number of 2D points different to the number of 3D points." );
560 size_t size = points3D_list.size();
564 for(
size_t i=0 ; i< size ; i++)
566 P[i].
setWorldCoordinates(points3D_list[i].get_oX(),points3D_list[i].get_oY(),points3D_list[i].get_oZ()) ;
611 char s[FILENAME_MAX];
615 std::string ext =
".pos";
616 size_t pos = initFile.rfind(ext);
618 if( pos == initFile.size()-ext.size() && pos != 0)
619 sprintf(s,
"%s", initFile.c_str());
621 sprintf(s,
"%s.pos", initFile.c_str());
623 std::cout <<
"filename " << s << std::endl ;
624 finit.open(s,std::ios::in) ;
626 std::cout <<
"cannot read " << s << std::endl;
630 for (
unsigned int i = 0; i < 6; i += 1){
631 finit >> init_pos[i];
670 std::fstream finitpos ;
671 char s[FILENAME_MAX];
673 sprintf(s,
"%s", filename.c_str());
674 finitpos.open(s, std::ios::out) ;
677 finitpos << init_pos;
707 std::string::const_iterator it;
710 it = modelFile.end();
711 if((*(it-1) ==
'o' && *(it-2) ==
'a' && *(it-3) ==
'c' && *(it-4) ==
'.') ||
712 (*(it-1) ==
'O' && *(it-2) ==
'A' && *(it-3) ==
'C' && *(it-4) ==
'.') ){
715 else if((*(it-1) ==
'l' && *(it-2) ==
'r' && *(it-3) ==
'w' && *(it-4) ==
'.') ||
716 (*(it-1) ==
'L' && *(it-2) ==
'R' && *(it-3) ==
'W' && *(it-4) ==
'.') ){
765 #ifdef VISP_HAVE_COIN
769 SbBool ok = in.openFile(modelFile.c_str());
770 SoSeparator *sceneGraph;
771 SoVRMLGroup *sceneGraphVRML2;
778 if(!in.isFileVRML2())
780 sceneGraph = SoDB::readAll(&in);
781 if (sceneGraph == NULL) { }
784 SoToVRML2Action tovrml2;
785 tovrml2.apply(sceneGraph);
787 sceneGraphVRML2 =tovrml2.getVRML2SceneGraph();
788 sceneGraphVRML2->ref();
793 sceneGraphVRML2 = SoDB::readAllVRML(&in);
794 if (sceneGraphVRML2 == NULL) { }
795 sceneGraphVRML2->ref();
801 unsigned int indexFace = 0;
804 sceneGraphVRML2->unref();
806 vpERROR_TRACE(
"coin not detected with ViSP, cannot load model : %s", modelFile.c_str());
840 std::ifstream fileId;
841 fileId.exceptions ( std::ifstream::failbit | std::ifstream::eofbit );
842 fileId.open (modelFile.c_str(), std::ifstream::in);
844 std::cout <<
"cannot read CAO model file: " << modelFile << std::endl;
854 while (!fileId.fail() && (c ==
'#'))
856 fileId.ignore(256,
'\n');
864 fileId >> caoVersion;
867 std::cout <<
"in vpMbTracker::loadCAOModel() -> Bad parameter header file : use V0, V1, ...";
869 "in vpMbTracker::loadCAOModel() -> Bad parameter header file : use V0, V1, ...");
874 while (!fileId.fail() && (c !=
'\n'))
881 while (!fileId.fail() && (c ==
'#'))
883 fileId.ignore(256,
'\n');
889 unsigned int caoNbrPoint;
890 fileId >> caoNbrPoint;
891 std::cout <<
"> " << caoNbrPoint <<
" points" << std::endl;
892 if (caoNbrPoint > 100000) {
894 "Exceed the max number of points in the CAO model.");
897 if (caoNbrPoint == 0) {
899 "in vpMbTracker::loadCAOModel() -> no points are defined");
911 for(
unsigned int k=0; k < caoNbrPoint; k++){
915 if (caoVersion == 2){
920 if(k != caoNbrPoint-1){
921 fileId.ignore(256,
'\n');
928 while (!fileId.fail() && (c !=
'\n'))
935 while (!fileId.fail() && (c ==
'#'))
937 fileId.ignore(256,
'\n');
943 unsigned int caoNbrLine;
944 fileId >> caoNbrLine;
945 unsigned int *caoLinePoints = NULL;
946 std::cout <<
"> " << caoNbrLine <<
" lines" << std::endl;
948 if (caoNbrLine > 100000) {
951 "Exceed the max number of lines in the CAO model.");
955 caoLinePoints =
new unsigned int[2*caoNbrLine];
957 unsigned int index1, index2;
959 for(
unsigned int k=0; k < caoNbrLine ; k++){
963 caoLinePoints[2*k] = index1;
964 caoLinePoints[2*k+1] = index2;
966 if(index1 < caoNbrPoint && index2 < caoNbrPoint){
967 std::vector<vpPoint> extremities;
968 extremities.push_back(caoPoints[index1]);
969 extremities.push_back(caoPoints[index2]);
973 vpTRACE(
" line %d has wrong coordinates.", k);
976 if(k != caoNbrLine-1){
977 fileId.ignore(256,
'\n');
983 while (!fileId.fail() && (c !=
'\n'))
990 while (!fileId.fail() && (c ==
'#'))
992 fileId.ignore(256,
'\n');
999 unsigned int caoNbrPolygonLine;
1000 fileId >> caoNbrPolygonLine;
1001 std::cout <<
"> " << caoNbrPolygonLine <<
" polygon line" << std::endl;
1002 if (caoNbrPolygonLine > 100000) {
1003 delete [] caoPoints;
1004 delete [] caoLinePoints;
1009 for(
unsigned int k = 0;k < caoNbrPolygonLine; k++){
1010 unsigned int nbLinePol;
1011 fileId >> nbLinePol;
1012 std::vector<vpPoint> corners;
1013 if (nbLinePol > 100000) {
1017 for(
unsigned int n = 0; n < nbLinePol; n++){
1019 if (2*index > 2*caoNbrLine-1) {
1023 corners.push_back(caoPoints[caoLinePoints[2*index]]);
1025 if(k != caoNbrPolygonLine-1){
1026 fileId.ignore(256,
'\n');
1033 while (!fileId.fail() && (c !=
'\n'))
1040 while (!fileId.fail() && (c ==
'#'))
1042 fileId.ignore(256,
'\n');
1048 unsigned int caoNbrPolygonPoint;
1049 fileId >> caoNbrPolygonPoint;
1050 std::cout <<
"> " << caoNbrPolygonPoint <<
" polygon point" << std::endl;
1052 if (caoNbrPolygonPoint > 100000) {
1056 for(
unsigned int k = 0;k < caoNbrPolygonPoint; k++){
1057 unsigned int nbPointPol;
1058 fileId >> nbPointPol;
1059 if (nbPointPol > 100000) {
1063 std::vector<vpPoint> corners;
1064 for(
unsigned int n = 0; n < nbPointPol; n++){
1066 if (index > caoNbrPoint-1) {
1069 corners.push_back(caoPoints[index]);
1071 if(k != caoNbrPolygonPoint-1){
1072 fileId.ignore(256,
'\n');
1077 unsigned int caoNbCylinder;
1081 while (!fileId.fail() && (c !=
'\n'))
1088 while (!fileId.fail() && (c ==
'#'))
1090 fileId.ignore(256,
'\n');
1096 delete[] caoLinePoints;
1103 fileId >> caoNbCylinder;
1104 std::cout <<
"> " << caoNbCylinder <<
" cylinder" << std::endl;
1105 if (caoNbCylinder > 100000) {
1109 for(
unsigned int k=0; k<caoNbCylinder; ++k){
1111 unsigned int indexP1, indexP2;
1115 initCylinder(caoPoints[indexP1], caoPoints[indexP2], radius);
1119 std::cerr <<
"Cannot get the number of cylinders. Defaulting to zero." << std::endl;
1124 delete[] caoLinePoints;
1125 }
catch(std::ifstream::failure e){
1126 std::cerr <<
"Cannot read line!" << std::endl;
1132 #ifdef VISP_HAVE_COIN
1144 SoVRMLTransform *sceneGraphVRML2Trasnform =
dynamic_cast<SoVRMLTransform *
>(sceneGraphVRML2);
1145 if(sceneGraphVRML2Trasnform){
1146 float rx, ry, rz, rw;
1147 sceneGraphVRML2Trasnform->rotation.getValue().getValue(rx,ry,rz,rw);
1152 tx = sceneGraphVRML2Trasnform->translation.getValue()[0];
1153 ty = sceneGraphVRML2Trasnform->translation.getValue()[1];
1154 tz = sceneGraphVRML2Trasnform->translation.getValue()[2];
1159 sx = sceneGraphVRML2Trasnform->scale.getValue()[0];
1160 sy = sceneGraphVRML2Trasnform->scale.getValue()[1];
1161 sz = sceneGraphVRML2Trasnform->scale.getValue()[2];
1164 for(
unsigned int i = 0 ; i < 3 ; i++)
1166 for(
unsigned int i = 0 ; i < 3 ; i++)
1168 for(
unsigned int i = 0 ; i < 3 ; i++)
1172 transform = transform * transformCur;
1175 int nbShapes = sceneGraphVRML2->getNumChildren();
1181 for (
int i = 0; i < nbShapes; i++)
1184 child = sceneGraphVRML2->getChild(i);
1186 if (child->getTypeId() == SoVRMLGroup::getClassTypeId()){
1187 extractGroup((SoVRMLGroup*)child, transform_recursive, indexFace);
1190 if (child->getTypeId() == SoVRMLTransform::getClassTypeId()){
1191 extractGroup((SoVRMLTransform*)child, transform_recursive, indexFace);
1194 if (child->getTypeId() == SoVRMLShape::getClassTypeId()){
1195 SoChildList * child2list = child->getChildren();
1196 for (
int j = 0; j < child2list->getLength(); j++)
1198 if (((SoNode*)child2list->get(j))->getTypeId() == SoVRMLIndexedFaceSet::getClassTypeId())
1200 SoVRMLIndexedFaceSet * face_set;
1201 face_set = (SoVRMLIndexedFaceSet*)child2list->get(j);
1202 if(!strncmp(face_set->getName().getString(),
"cyl",3)){
1208 if (((SoNode*)child2list->get(j))->getTypeId() == SoVRMLIndexedLineSet::getClassTypeId())
1210 SoVRMLIndexedLineSet * line_set;
1211 line_set = (SoVRMLIndexedLineSet*)child2list->get(j);
1230 std::vector<vpPoint> corners;
1235 int indexListSize = face_set->coordIndex.getNum();
1239 SoVRMLCoordinate *coord;
1241 for (
int i = 0; i < indexListSize; i++)
1243 if (face_set->coordIndex[i] == -1)
1245 if(corners.size() > 1)
1254 coord = (SoVRMLCoordinate *)(face_set->coord.getValue());
1255 int index = face_set->coordIndex[i];
1256 pointTransformed[0]=coord->point[index].getValue()[0];
1257 pointTransformed[1]=coord->point[index].getValue()[1];
1258 pointTransformed[2]=coord->point[index].getValue()[2];
1259 pointTransformed[3] = 1.0;
1261 pointTransformed = transform * pointTransformed;
1264 corners.push_back(pt);
1284 std::vector<vpPoint> corners_c1, corners_c2;
1285 SoVRMLCoordinate* coords = (SoVRMLCoordinate *)face_set->coord.getValue();
1287 unsigned int indexListSize = (
unsigned int)coords->point.getNum();
1289 if(indexListSize % 2 == 1){
1290 std::cout <<
"Not an even number of points when extracting a cylinder." << std::endl;
1293 corners_c1.resize(indexListSize / 2);
1294 corners_c2.resize(indexListSize / 2);
1300 for(
int i=0; i<coords->point.getNum(); ++i){
1301 pointTransformed[0]=coords->point[i].getValue()[0];
1302 pointTransformed[1]=coords->point[i].getValue()[1];
1303 pointTransformed[2]=coords->point[i].getValue()[2];
1304 pointTransformed[3] = 1.0;
1306 pointTransformed = transform * pointTransformed;
1310 if(i < (
int)corners_c1.size()){
1311 corners_c1[(
unsigned int)i] = pt;
1313 corners_c2[(
unsigned int)i-corners_c1.size()] = pt;
1321 dist[0] = p1.
get_oX() - corners_c1[0].get_oX();
1322 dist[1] = p1.
get_oY() - corners_c1[0].get_oY();
1323 dist[2] = p1.
get_oZ() - corners_c1[0].get_oZ();
1324 double radius_c1 = sqrt(dist.
sumSquare());
1325 dist[0] = p2.
get_oX() - corners_c2[0].get_oX();
1326 dist[1] = p2.
get_oY() - corners_c2[0].get_oY();
1327 dist[2] = p2.
get_oZ() - corners_c2[0].get_oZ();
1328 double radius_c2 = sqrt(dist.sumSquare());
1330 if(std::fabs(radius_c1 - radius_c2) > (std::numeric_limits<double>::epsilon() *
vpMath::maximum(radius_c1, radius_c2))){
1331 std::cout <<
"Radius from the two circles of the cylinders are different." << std::endl;
1352 std::cout <<
"Cannot extract center of gravity of empty set." << std::endl;
1360 for(
unsigned int i=0; i<pts.size(); ++i){
1362 oY += pts[i].get_oY();
1363 oZ += pts[i].get_oZ();
1380 std::vector<vpPoint> corners;
1383 int indexListSize = line_set->coordIndex.getNum();
1385 SbVec3f point(0,0,0);
1387 SoVRMLCoordinate *coord;
1389 unsigned int indexFace = 0;
1391 for (
int i = 0; i < indexListSize; i++)
1393 if (line_set->coordIndex[i] == -1)
1395 if(corners.size() > 1)
1404 coord = (SoVRMLCoordinate *)(line_set->coord.getValue());
1405 int index = line_set->coordIndex[i];
1406 point[0]=coord->point[index].getValue()[0];
1407 point[1]=coord->point[index].getValue()[1];
1408 point[2]=coord->point[index].getValue()[2];
1411 corners.push_back(pt);
1437 "Incorrect matrices size in computeJTR.");
1441 const unsigned int N = interaction.
getRows();
1443 for (
unsigned int i = 0; i < 6; i += 1){
1445 for (
unsigned int j = 0; j < N; j += 1){
1446 ssum += interaction[j][i] * error[j];
void init(vpImage< unsigned char > &I, int winx=-1, int winy=-1, const char *title=NULL)
Definition of the vpMatrix class.
virtual void extractCylinders(SoVRMLIndexedFaceSet *face_set, vpHomogeneousMatrix &transform)
void resize(const unsigned int nrows, const unsigned int ncols, const bool nullify=true)
virtual void extractLines(SoVRMLIndexedLineSet *line_set)
The class provides a data structure for the homogeneous matrices as well as a set of operations on th...
virtual void initFaceFromCorners(const std::vector< vpPoint > &corners, const unsigned int indexFace=-1)=0
void setIdentity()
Basic initialisation (identity)
Display for windows using GDI (available on any windows 32 platform).
vpPoint getGravityCenter(const std::vector< vpPoint > &_pts)
vpHomogeneousMatrix cMo
The current pose.
Define the X11 console to display images.
bool modelInitialised
Flag used to ensure that the CAD model is loaded before the initialisation.
double get_oY() const
Get the point Y coordinate in the object frame.
error that can be emited by ViSP classes.
void computeJTR(const vpMatrix &J, const vpColVector &R, vpMatrix &JTR)
void set_x(const double x)
Set the point x coordinate in the image plane.
static void convertPoint(const vpCameraParameters &cam, const double &u, const double &v, double &x, double &y)
Point coordinates conversion from pixel coordinates to normalized coordinates in meter...
virtual void extractFaces(SoVRMLIndexedFaceSet *face_set, vpHomogeneousMatrix &transform, unsigned int &indexFace)
std::string modelFileName
The name of the file containing the model (it is used to create a file name.0.pos used to store the c...
virtual void initFromPose(const vpImage< unsigned char > &I, const std::string &initFile)
double sumSquare() const
return sum of the Aij^2 (for all i, for all j)
static const vpColor green
static void flush(const vpImage< unsigned char > &I)
Class that defines what is a point.
virtual void loadCAOModel(const std::string &modelFile)
vpPoseVector buildFrom(const vpHomogeneousMatrix &M)
vpCameraParameters cam
The camera parameters.
static Type maximum(const Type &a, const Type &b)
The vpRotationMatrix considers the particular case of a rotation matrix.
virtual void init(const vpImage< unsigned char > &I)=0
virtual void display(const vpImage< unsigned char > &I, const vpHomogeneousMatrix &cMo, const vpCameraParameters &cam, const vpColor &col, const unsigned int thickness=1, const bool displayFullModel=false)=0
void savePose(const std::string &filename)
static void display(const vpImage< unsigned char > &I)
The vpDisplayOpenCV allows to display image using the opencv library.
virtual void displayCross(const vpImagePoint &ip, unsigned int size, const vpColor &color, unsigned int thickness=1)=0
Class used for pose computation from N points (pose from point only).
virtual void loadModel(const std::string &modelFile)
double get_oZ() const
Get the point Z coordinate in the object frame.
void set_y(const double y)
Set the point y coordinate in the image plane.
virtual void loadVRMLModel(const std::string &modelFile)
Defines a quaternion and its basic operations.
virtual void initClick(const vpImage< unsigned char > &I, const std::string &initFile, const bool displayHelp=false)
static void displayFrame(const vpImage< unsigned char > &I, const vpHomogeneousMatrix &cMo, const vpCameraParameters &cam, double size, const vpColor &color, unsigned int thickness=1)
void buildFrom(const vpTranslationVector &t, const vpRotationMatrix &R)
Construction from translation vector and rotation matrix.
std::string poseSavingFilename
Filename used to save the initial pose computed using the initClick() method. It is also used to read...
double get_oX() const
Get the point X coordinate in the object frame.
Class that provides a data structure for the column vectors as well as a set of operations on these v...
virtual void displayCharString(const vpImagePoint &ip, const char *text, const vpColor &color=vpColor::green)=0
The pose is a complete representation of every rigid motion in the euclidian space.
unsigned int getCols() const
Return the number of columns of the matrix.
error that can be emited by the vpMatrix class and its derivates
void computePose(vpPoseMethodType methode, vpHomogeneousMatrix &cMo)
compute the pose for a given method
virtual bool getClick(bool blocking=true)=0
Class that defines a 2D point in an image. This class is useful for image processing and stores only ...
virtual void initFromPoints(const vpImage< unsigned char > &I, const std::string &initFile)
static void read(vpImage< unsigned char > &I, const char *filename)
unsigned int getRows() const
Return the number of rows of the matrix.
void addPoint(const vpPoint &P)
Add a new point in this array.
Class that consider the case of a translation vector.
virtual void displayPoint(const vpImagePoint &ip, const vpColor &color)=0
double computeResidual(const vpHomogeneousMatrix &cMo) const
Compute and return the residual expressed in meter for the pose matrix 'cMo'.
void setWorldCoordinates(const double ox, const double oy, const double oz)
Set the point world coordinates. We mean here the coordinates of the point in the object frame...
virtual void initCylinder(const vpPoint &p1, const vpPoint &p2, const double radius, const unsigned int indexCylinder=0)=0
void clearPoint()
suppress all the point in the array of point
virtual void extractGroup(SoVRMLGroup *sceneGraphVRML2, vpHomogeneousMatrix &transform, unsigned int &indexFace)