36 #include <visp3/core/vpImageConvert.h>
37 #include <visp3/core/vpMatrixException.h>
38 #include <visp3/core/vpMeterPixelConversion.h>
39 #include <visp3/core/vpPixelMeterConversion.h>
40 #include <visp3/core/vpPolygon3D.h>
41 #include <visp3/core/vpRotationMatrix.h>
42 #include <visp3/robot/vpImageSimulator.h>
44 #ifdef VISP_HAVE_MODULE_IO
45 #include <visp3/io/vpImageIo.h>
59 : cMt(), pt(), ptClipped(), interp(SIMPLE), normal_obj(), normal_Cam(), normal_Cam_optim(), distance(1.),
60 visible_result(1.), visible(false), X0_2_optim(nullptr), frobeniusNorm_u(0.), fronbniusNorm_v(0.), vbase_u(),
61 vbase_v(), vbase_u_optim(nullptr), vbase_v_optim(nullptr), Xinter_optim(nullptr), listTriangle(), colorI(col), Ig(), Ic(),
62 rect(), cleanPrevImage(false), setBackgroundTexture(false), bgColor(
vpColor::white), focal(), needClipping(false)
64 for (
int i = 0; i < 4; i++)
67 for (
int i = 0; i < 4; i++)
83 normal_Cam_optim =
new double[3];
84 X0_2_optim =
new double[3];
85 vbase_u_optim =
new double[3];
86 vbase_v_optim =
new double[3];
87 Xinter_optim =
new double[3];
96 : cMt(), pt(), ptClipped(), interp(SIMPLE), normal_obj(), normal_Cam(), normal_Cam_optim(), distance(1.),
97 visible_result(1.), visible(false), X0_2_optim(nullptr), frobeniusNorm_u(0.), fronbniusNorm_v(0.), vbase_u(),
98 vbase_v(), vbase_u_optim(nullptr), vbase_v_optim(nullptr), Xinter_optim(nullptr), listTriangle(), colorI(GRAY_SCALED), Ig(),
99 Ic(), rect(), cleanPrevImage(false), setBackgroundTexture(false), bgColor(
vpColor::white), focal(),
103 for (
unsigned int i = 0; i < 4; i++) {
108 for (
int i = 0; i < 4; i++)
118 normal_obj = text.normal_obj;
119 frobeniusNorm_u = text.frobeniusNorm_u;
120 fronbniusNorm_v = text.fronbniusNorm_v;
126 normal_Cam_optim =
new double[3];
127 X0_2_optim =
new double[3];
128 vbase_u_optim =
new double[3];
129 vbase_v_optim =
new double[3];
130 Xinter_optim =
new double[3];
132 colorI = text.colorI;
133 interp = text.interp;
134 bgColor = text.bgColor;
135 cleanPrevImage = text.cleanPrevImage;
136 setBackgroundTexture =
false;
146 delete[] normal_Cam_optim;
148 delete[] vbase_u_optim;
149 delete[] vbase_v_optim;
150 delete[] Xinter_optim;
155 for (
unsigned int i = 0; i < 4; i++) {
163 bgColor = sim.bgColor;
164 cleanPrevImage = sim.cleanPrevImage;
168 normal_obj = sim.normal_obj;
169 frobeniusNorm_u = sim.frobeniusNorm_u;
170 fronbniusNorm_v = sim.fronbniusNorm_v;
187 if (setBackgroundTexture)
191 if (cleanPrevImage) {
192 unsigned char col = (
unsigned char)(0.2126 * bgColor.
R + 0.7152 * bgColor.
G + 0.0722 * bgColor.
B);
193 for (
unsigned int i = 0; i < I.
getHeight(); i++) {
194 for (
unsigned int j = 0; j < I.
getWidth(); j++) {
207 double top = rect.
getTop();
212 unsigned char *bitmap = I.
bitmap;
216 for (
unsigned int i = (
unsigned int)top; i < (
unsigned int)bottom; i++) {
217 for (
unsigned int j = (
unsigned int)left; j < (
unsigned int)right; j++) {
223 unsigned char Ipixelplan = 0;
224 if (getPixel(ip, Ipixelplan)) {
225 *(bitmap + i * width + j) = Ipixelplan;
227 }
else if (colorI ==
COLORED) {
229 if (getPixel(ip, Ipixelplan)) {
230 unsigned char pixelgrey =
231 (
unsigned char)(0.2126 * Ipixelplan.
R + 0.7152 * Ipixelplan.
G + 0.0722 * Ipixelplan.
B);
232 *(bitmap + i * width + j) = pixelgrey;
251 if (cleanPrevImage) {
252 unsigned char col = (
unsigned char)(0.2126 * bgColor.
R + 0.7152 * bgColor.
G + 0.0722 * bgColor.
B);
253 for (
unsigned int i = 0; i < I.
getHeight(); i++) {
254 for (
unsigned int j = 0; j < I.
getWidth(); j++) {
265 double top = rect.
getTop();
270 unsigned char *bitmap = I.
bitmap;
274 for (
unsigned int i = (
unsigned int)top; i < (
unsigned int)bottom; i++) {
275 for (
unsigned int j = (
unsigned int)left; j < (
unsigned int)right; j++) {
280 unsigned char Ipixelplan = 0;
281 if (getPixel(Isrc, ip, Ipixelplan)) {
282 *(bitmap + i * width + j) = Ipixelplan;
308 " zBuffer must have the same size as the image I ! "));
310 if (cleanPrevImage) {
311 unsigned char col = (
unsigned char)(0.2126 * bgColor.
R + 0.7152 * bgColor.
G + 0.0722 * bgColor.
B);
312 for (
unsigned int i = 0; i < I.
getHeight(); i++) {
313 for (
unsigned int j = 0; j < I.
getWidth(); j++) {
324 double top = rect.
getTop();
329 unsigned char *bitmap = I.
bitmap;
333 for (
unsigned int i = (
unsigned int)top; i < (
unsigned int)bottom; i++) {
334 for (
unsigned int j = (
unsigned int)left; j < (
unsigned int)right; j++) {
340 unsigned char Ipixelplan;
341 if (getPixel(ip, Ipixelplan)) {
342 if (Xinter_optim[2] < zBuffer[i][j] || zBuffer[i][j] < 0) {
343 *(bitmap + i * width + j) = Ipixelplan;
344 zBuffer[i][j] = Xinter_optim[2];
347 }
else if (colorI ==
COLORED) {
349 if (getPixel(ip, Ipixelplan)) {
350 if (Xinter_optim[2] < zBuffer[i][j] || zBuffer[i][j] < 0) {
351 unsigned char pixelgrey =
352 (
unsigned char)(0.2126 * Ipixelplan.
R + 0.7152 * Ipixelplan.
G + 0.0722 * Ipixelplan.
B);
353 *(bitmap + i * width + j) = pixelgrey;
354 zBuffer[i][j] = Xinter_optim[2];
372 if (cleanPrevImage) {
373 for (
unsigned int i = 0; i < I.
getHeight(); i++) {
374 for (
unsigned int j = 0; j < I.
getWidth(); j++) {
386 double top = rect.
getTop();
395 for (
unsigned int i = (
unsigned int)top; i < (
unsigned int)bottom; i++) {
396 for (
unsigned int j = (
unsigned int)left; j < (
unsigned int)right; j++) {
402 unsigned char Ipixelplan;
403 if (getPixel(ip, Ipixelplan)) {
405 pixelcolor.
R = Ipixelplan;
406 pixelcolor.
G = Ipixelplan;
407 pixelcolor.
B = Ipixelplan;
408 *(bitmap + i * width + j) = pixelcolor;
410 }
else if (colorI ==
COLORED) {
412 if (getPixel(ip, Ipixelplan)) {
413 *(bitmap + i * width + j) = Ipixelplan;
432 if (cleanPrevImage) {
433 for (
unsigned int i = 0; i < I.
getHeight(); i++) {
434 for (
unsigned int j = 0; j < I.
getWidth(); j++) {
446 double top = rect.
getTop();
455 for (
unsigned int i = (
unsigned int)top; i < (
unsigned int)bottom; i++) {
456 for (
unsigned int j = (
unsigned int)left; j < (
unsigned int)right; j++) {
462 if (getPixel(Isrc, ip, Ipixelplan)) {
463 *(bitmap + i * width + j) = Ipixelplan;
489 " zBuffer must have the same size as the image I ! "));
491 if (cleanPrevImage) {
492 for (
unsigned int i = 0; i < I.
getHeight(); i++) {
493 for (
unsigned int j = 0; j < I.
getWidth(); j++) {
504 double top = rect.
getTop();
513 for (
unsigned int i = (
unsigned int)top; i < (
unsigned int)bottom; i++) {
514 for (
unsigned int j = (
unsigned int)left; j < (
unsigned int)right; j++) {
520 unsigned char Ipixelplan;
521 if (getPixel(ip, Ipixelplan)) {
522 if (Xinter_optim[2] < zBuffer[i][j] || zBuffer[i][j] < 0) {
524 pixelcolor.
R = Ipixelplan;
525 pixelcolor.
G = Ipixelplan;
526 pixelcolor.
B = Ipixelplan;
527 *(bitmap + i * width + j) = pixelcolor;
528 zBuffer[i][j] = Xinter_optim[2];
531 }
else if (colorI ==
COLORED) {
533 if (getPixel(ip, Ipixelplan)) {
534 if (Xinter_optim[2] < zBuffer[i][j] || zBuffer[i][j] < 0) {
535 *(bitmap + i * width + j) = Ipixelplan;
536 zBuffer[i][j] = Xinter_optim[2];
656 unsigned int nbsimList = (
unsigned int)list.size();
663 double topFinal = height + 1;
665 double bottomFinal = -1;
666 double leftFinal = width + 1;
667 double rightFinal = -1;
669 unsigned int unvisible = 0;
670 unsigned int indexSimu = 0;
671 for (std::list<vpImageSimulator>::iterator it = list.begin(); it != list.end(); ++it, ++indexSimu) {
674 simList[indexSimu] = sim;
678 nbsimList = nbsimList - unvisible;
685 for (
unsigned int i = 0; i < nbsimList; i++) {
686 if (!simList[i]->needClipping)
687 simList[i]->getRoi(width, height, cam, simList[i]->pt, simList[i]->rect);
689 simList[i]->getRoi(width, height, cam, simList[i]->ptClipped, simList[i]->rect);
691 if (topFinal > simList[i]->rect.
getTop())
692 topFinal = simList[i]->rect.
getTop();
693 if (bottomFinal < simList[i]->rect.
getBottom())
694 bottomFinal = simList[i]->rect.
getBottom();
695 if (leftFinal > simList[i]->rect.
getLeft())
696 leftFinal = simList[i]->rect.
getLeft();
697 if (rightFinal < simList[i]->rect.
getRight())
698 rightFinal = simList[i]->rect.
getRight();
703 unsigned char *bitmap = I.
bitmap;
706 for (
unsigned int i = (
unsigned int)topFinal; i < (
unsigned int)bottomFinal; i++) {
707 for (
unsigned int j = (
unsigned int)leftFinal; j < (
unsigned int)rightFinal; j++) {
713 for (
int k = 0; k < (int)nbsimList; k++) {
715 if (simList[k]->getPixelDepth(ip, z)) {
716 if (z < zmin || zmin < 0) {
724 unsigned char Ipixelplan = 255;
725 simList[indice]->getPixel(ip, Ipixelplan);
726 *(bitmap + i * width + j) = Ipixelplan;
727 }
else if (simList[indice]->colorI ==
COLORED) {
728 vpRGBa Ipixelplan(255, 255, 255);
729 simList[indice]->getPixel(ip, Ipixelplan);
730 unsigned char pixelgrey =
731 (
unsigned char)(0.2126 * Ipixelplan.
R + 0.7152 * Ipixelplan.
G + 0.0722 * Ipixelplan.
B);
732 *(bitmap + i * width + j) = pixelgrey;
853 unsigned int nbsimList = (
unsigned int)list.size();
860 double topFinal = height + 1;
862 double bottomFinal = -1;
863 double leftFinal = width + 1;
864 double rightFinal = -1;
866 unsigned int unvisible = 0;
867 unsigned int indexSimu = 0;
868 for (std::list<vpImageSimulator>::iterator it = list.begin(); it != list.end(); ++it, ++indexSimu) {
871 simList[indexSimu] = sim;
876 nbsimList = nbsimList - unvisible;
883 for (
unsigned int i = 0; i < nbsimList; i++) {
884 if (!simList[i]->needClipping)
885 simList[i]->getRoi(width, height, cam, simList[i]->pt, simList[i]->rect);
887 simList[i]->getRoi(width, height, cam, simList[i]->ptClipped, simList[i]->rect);
889 if (topFinal > simList[i]->rect.
getTop())
890 topFinal = simList[i]->rect.
getTop();
891 if (bottomFinal < simList[i]->rect.
getBottom())
892 bottomFinal = simList[i]->rect.
getBottom();
893 if (leftFinal > simList[i]->rect.
getLeft())
894 leftFinal = simList[i]->rect.
getLeft();
895 if (rightFinal < simList[i]->rect.
getRight())
896 rightFinal = simList[i]->rect.
getRight();
904 for (
unsigned int i = (
unsigned int)topFinal; i < (
unsigned int)bottomFinal; i++) {
905 for (
unsigned int j = (
unsigned int)leftFinal; j < (
unsigned int)rightFinal; j++) {
911 for (
int k = 0; k < (int)nbsimList; k++) {
913 if (simList[k]->getPixelDepth(ip, z)) {
914 if (z < zmin || zmin < 0) {
922 unsigned char Ipixelplan = 255;
923 simList[indice]->getPixel(ip, Ipixelplan);
925 pixelcolor.
R = Ipixelplan;
926 pixelcolor.
G = Ipixelplan;
927 pixelcolor.
B = Ipixelplan;
928 *(bitmap + i * width + j) = pixelcolor;
929 }
else if (simList[indice]->colorI ==
COLORED) {
930 vpRGBa Ipixelplan(255, 255, 255);
931 simList[indice]->getPixel(ip, Ipixelplan);
934 *(bitmap + i * width + j) = Ipixelplan;
953 needClipping =
false;
955 normal_Cam = R * normal_obj;
959 for (
unsigned int i = 0; i < 4; i++)
966 e1[0] = pt[1].get_X() - pt[0].get_X();
967 e1[1] = pt[1].get_Y() - pt[0].get_Y();
968 e1[2] = pt[1].get_Z() - pt[0].get_Z();
970 e2[0] = pt[2].get_X() - pt[1].get_X();
971 e2[1] = pt[2].get_Y() - pt[1].get_Y();
972 e2[2] = pt[2].get_Z() - pt[1].get_Z();
976 double angle = pt[0].get_X() * facenormal[0] + pt[0].get_Y() * facenormal[1] + pt[0].get_Z() * facenormal[2];
985 for (
unsigned int i = 0; i < 4; i++) {
986 project(X[i], cMt, X2[i]);
988 if (pt[i].get_Z() < 0)
992 vbase_u = X2[1] - X2[0];
993 vbase_v = X2[3] - X2[0];
1002 for (
unsigned int i = 0; i < 3; i++) {
1003 normal_Cam_optim[i] = normal_Cam[i];
1004 X0_2_optim[i] = X2[0][i];
1005 vbase_u_optim[i] = vbase_u[i];
1006 vbase_v_optim[i] = vbase_v[i];
1009 std::vector<vpPoint> *ptPtr = &pt;
1015 listTriangle.clear();
1016 for (
unsigned int i = 1; i < (*ptPtr).size() - 1; i++) {
1018 ip1.
set_j((*ptPtr)[0].get_x());
1019 ip1.
set_i((*ptPtr)[0].get_y());
1021 ip2.
set_j((*ptPtr)[i].get_x());
1022 ip2.
set_i((*ptPtr)[i].get_y());
1024 ip3.
set_j((*ptPtr)[i + 1].get_x());
1025 ip3.
set_i((*ptPtr)[i + 1].get_y());
1028 listTriangle.push_back(tri);
1035 for (
unsigned int i = 0; i < 4; i++) {
1037 pt[i].setWorldCoordinates(X_[i][0], X_[i][1], X_[i][2]);
1043 frobeniusNorm_u = (X[1] - X[0]).frobeniusNorm();
1044 fronbniusNorm_v = (X[3] - X[0]).frobeniusNorm();
1089 #ifdef VISP_HAVE_MODULE_IO
1130 if (X_.size() != 4) {
1134 for (
unsigned int i = 0; i < 4; ++i) {
1136 Xvec[i][0] = X_[i].get_oX();
1137 Xvec[i][1] = X_[i].get_oY();
1138 Xvec[i][2] = X_[i].get_oZ();
1162 if (X_.size() != 4) {
1166 for (
unsigned int i = 0; i < 4; ++i) {
1168 Xvec[i][0] = X_[i].get_oX();
1169 Xvec[i][1] = X_[i].get_oY();
1170 Xvec[i][2] = X_[i].get_oZ();
1178 #ifdef VISP_HAVE_MODULE_IO
1197 if (X_.size() != 4) {
1201 for (
unsigned int i = 0; i < 4; ++i) {
1203 Xvec[i][0] = X_[i].get_oX();
1204 Xvec[i][1] = X_[i].get_oY();
1205 Xvec[i][2] = X_[i].get_oZ();
1214 bool vpImageSimulator::getPixel(
const vpImagePoint &iP,
unsigned char &Ipixelplan)
1218 bool inside =
false;
1219 for (
unsigned int i = 0; i < listTriangle.size(); i++)
1220 if (listTriangle[i].inTriangle(iP)) {
1236 z = distance / (normal_Cam_optim[0] * iP.
get_u() + normal_Cam_optim[1] * iP.
get_v() + normal_Cam_optim[2]);
1238 Xinter_optim[0] = iP.
get_u() * z;
1239 Xinter_optim[1] = iP.
get_v() * z;
1240 Xinter_optim[2] = z;
1248 double u = 0, v = 0;
1249 for (
unsigned int i = 0; i < 3; i++) {
1250 double diff = (Xinter_optim[i] - X0_2_optim[i]);
1251 u += diff * vbase_u_optim[i];
1252 v += diff * vbase_v_optim[i];
1254 u = u / (frobeniusNorm_u * frobeniusNorm_u);
1255 v = v / (fronbniusNorm_v * fronbniusNorm_v);
1257 if (u > 0 && v > 0 && u < 1. && v < 1.) {
1263 else if (interp ==
SIMPLE)
1264 Ipixelplan = Ig[(
unsigned int)i2][(
unsigned int)j2];
1273 bool inside =
false;
1274 for (
unsigned int i = 0; i < listTriangle.size(); i++)
1275 if (listTriangle[i].inTriangle(iP)) {
1289 z = distance / (normal_Cam_optim[0] * iP.
get_u() + normal_Cam_optim[1] * iP.
get_v() + normal_Cam_optim[2]);
1291 Xinter_optim[0] = iP.
get_u() * z;
1292 Xinter_optim[1] = iP.
get_v() * z;
1293 Xinter_optim[2] = z;
1301 double u = 0, v = 0;
1302 for (
unsigned int i = 0; i < 3; i++) {
1303 double diff = (Xinter_optim[i] - X0_2_optim[i]);
1304 u += diff * vbase_u_optim[i];
1305 v += diff * vbase_v_optim[i];
1307 u = u / (frobeniusNorm_u * frobeniusNorm_u);
1308 v = v / (fronbniusNorm_v * fronbniusNorm_v);
1310 if (u > 0 && v > 0 && u < 1. && v < 1.) {
1315 Ipixelplan = Isrc.
getValue(i2, j2);
1316 else if (interp ==
SIMPLE)
1317 Ipixelplan = Isrc[(
unsigned int)i2][(
unsigned int)j2];
1326 bool inside =
false;
1327 for (
unsigned int i = 0; i < listTriangle.size(); i++)
1328 if (listTriangle[i].inTriangle(iP)) {
1341 z = distance / (normal_Cam_optim[0] * iP.
get_u() + normal_Cam_optim[1] * iP.
get_v() + normal_Cam_optim[2]);
1343 Xinter_optim[0] = iP.
get_u() * z;
1344 Xinter_optim[1] = iP.
get_v() * z;
1345 Xinter_optim[2] = z;
1353 double u = 0, v = 0;
1354 for (
unsigned int i = 0; i < 3; i++) {
1355 double diff = (Xinter_optim[i] - X0_2_optim[i]);
1356 u += diff * vbase_u_optim[i];
1357 v += diff * vbase_v_optim[i];
1359 u = u / (frobeniusNorm_u * frobeniusNorm_u);
1360 v = v / (fronbniusNorm_v * fronbniusNorm_v);
1362 if (u > 0 && v > 0 && u < 1. && v < 1.) {
1368 else if (interp ==
SIMPLE)
1369 Ipixelplan = Ic[(
unsigned int)i2][(
unsigned int)j2];
1380 bool inside =
false;
1381 for (
unsigned int i = 0; i < listTriangle.size(); i++)
1382 if (listTriangle[i].inTriangle(iP)) {
1393 z = distance / (normal_Cam_optim[0] * iP.
get_u() + normal_Cam_optim[1] * iP.
get_v() + normal_Cam_optim[2]);
1395 Xinter_optim[0] = iP.
get_u() * z;
1396 Xinter_optim[1] = iP.
get_v() * z;
1397 Xinter_optim[2] = z;
1405 double u = 0, v = 0;
1406 for (
unsigned int i = 0; i < 3; i++) {
1407 double diff = (Xinter_optim[i] - X0_2_optim[i]);
1408 u += diff * vbase_u_optim[i];
1409 v += diff * vbase_v_optim[i];
1411 u = u / (frobeniusNorm_u * frobeniusNorm_u);
1412 v = v / (fronbniusNorm_v * fronbniusNorm_v);
1414 if (u > 0 && v > 0 && u < 1. && v < 1.) {
1419 Ipixelplan = Isrc.
getValue(i2, j2);
1420 else if (interp ==
SIMPLE)
1421 Ipixelplan = Isrc[(
unsigned int)i2][(
unsigned int)j2];
1427 bool vpImageSimulator::getPixelDepth(
const vpImagePoint &iP,
double &Zpixelplan)
1430 bool inside =
false;
1431 for (
unsigned int i = 0; i < listTriangle.size(); i++)
1432 if (listTriangle[i].inTriangle(iP)) {
1441 Zpixelplan = distance / (normal_Cam_optim[0] * iP.
get_u() + normal_Cam_optim[1] * iP.
get_v() + normal_Cam_optim[2]);
1445 bool vpImageSimulator::getPixelVisibility(
const vpImagePoint &iP,
double &Visipixelplan)
1448 bool inside =
false;
1449 for (
unsigned int i = 0; i < listTriangle.size(); i++)
1450 if (listTriangle[i].inTriangle(iP)) {
1459 Visipixelplan = visible_result;
1466 getHomogCoord(_vin, XH);
1467 getCoordFromHomog(_cMt * XH, _vout);
1472 for (
unsigned int i = 0; i < 3; i++)
1479 for (
unsigned int i = 0; i < 3; i++)
1480 _v[i] = _vH[i] / _vH[3];
1483 void vpImageSimulator::getRoi(
const unsigned int &Iwidth,
const unsigned int &Iheight,
const vpCameraParameters &cam,
1484 const std::vector<vpPoint> &point,
vpRect &rectangle)
1486 double top = Iheight + 1;
1489 double left = Iwidth + 1;
1491 for (
unsigned int i = 0; i < point.size(); i++) {
1492 double u = 0, v = 0;
1509 if (bottom >= Iheight)
1510 bottom = Iheight - 1;
1517 if (right >= Iwidth)
1528 std::vector<vpColVector> X_;
1529 for (
int i = 0; i < 4; i++)
unsigned int getCols() const
friend std::ostream & operator<<(std::ostream &s, const vpArray2D< Type > &A)
unsigned int getRows() const
Generic class defining intrinsic camera parameters.
Implementation of column vector and the associated operations.
static double dotProd(const vpColVector &a, const vpColVector &b)
static vpColVector crossProd(const vpColVector &a, const vpColVector &b)
double frobeniusNorm() const
void resize(unsigned int i, bool flagNullify=true)
Class to define RGB colors available for display functionalities.
error that can be emitted by ViSP classes.
@ dimensionError
Bad dimension.
Implementation of an homogeneous matrix and operations on such kind of matrices.
void extract(vpRotationMatrix &R) const
static void convert(const vpImage< unsigned char > &src, vpImage< vpRGBa > &dest)
static void read(vpImage< unsigned char > &I, const std::string &filename, int backend=IO_DEFAULT_BACKEND)
Class that defines a 2D point in an image. This class is useful for image processing and stores only ...
void set_ij(double ii, double jj)
Class which enables to project an image in the 3D space and get the view of a virtual camera.
void getImage(vpImage< unsigned char > &I, const vpCameraParameters &cam)
vpImageSimulator(const vpColorPlan &col=COLORED)
std::vector< vpColVector > get3DcornersTextureRectangle()
void init(const vpImage< unsigned char > &I, vpColVector *X)
void setCameraPosition(const vpHomogeneousMatrix &cMt)
vpImageSimulator & operator=(const vpImageSimulator &sim)
virtual ~vpImageSimulator()
unsigned int getWidth() const
Type getValue(unsigned int i, unsigned int j) const
Type * bitmap
points toward the bitmap
unsigned int getHeight() const
error that can be emitted by the vpMatrix class and its derivatives
@ incorrectMatrixSizeError
Incorrect matrix size.
Implementation of a matrix and operations on matrices.
static void convertPoint(const vpCameraParameters &cam, const double &x, const double &y, double &u, double &v)
static void convertPoint(const vpCameraParameters &cam, const double &u, const double &v, double &x, double &y)
static void getClippedPolygon(const std::vector< vpPoint > &ptIn, std::vector< vpPoint > &ptOut, const vpHomogeneousMatrix &cMo, const unsigned int &clippingFlags, const vpCameraParameters &cam=vpCameraParameters(), const double &znear=0.001, const double &zfar=100)
unsigned char B
Blue component.
unsigned char R
Red component.
unsigned char G
Green component.
Defines a rectangle in the plane.
void setRight(double pos)
void setBottom(double pos)
Implementation of a rotation matrix and operations on such kind of matrices.