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>
60 : cMt(), pt(), ptClipped(), interp(SIMPLE), normal_obj(), normal_Cam(), normal_Cam_optim(), distance(1.),
61 visible_result(1.), visible(false), X0_2_optim(nullptr), frobeniusNorm_u(0.), fronbniusNorm_v(0.), vbase_u(),
62 vbase_v(), vbase_u_optim(nullptr), vbase_v_optim(nullptr), Xinter_optim(nullptr), listTriangle(), colorI(col), Ig(), Ic(),
63 rect(), cleanPrevImage(false), setBackgroundTexture(false), bgColor(
vpColor::white), focal(), needClipping(false)
65 for (
int i = 0; i < 4; i++)
68 for (
int i = 0; i < 4; i++)
84 normal_Cam_optim =
new double[3];
85 X0_2_optim =
new double[3];
86 vbase_u_optim =
new double[3];
87 vbase_v_optim =
new double[3];
88 Xinter_optim =
new double[3];
97 : cMt(), pt(), ptClipped(), interp(SIMPLE), normal_obj(), normal_Cam(), normal_Cam_optim(), distance(1.),
98 visible_result(1.), visible(false), X0_2_optim(nullptr), frobeniusNorm_u(0.), fronbniusNorm_v(0.), vbase_u(),
99 vbase_v(), vbase_u_optim(nullptr), vbase_v_optim(nullptr), Xinter_optim(nullptr), listTriangle(), colorI(GRAY_SCALED), Ig(),
100 Ic(), rect(), cleanPrevImage(false), setBackgroundTexture(false), bgColor(
vpColor::white), focal(),
104 for (
unsigned int i = 0; i < 4; i++) {
109 for (
int i = 0; i < 4; i++)
119 normal_obj = text.normal_obj;
120 frobeniusNorm_u = text.frobeniusNorm_u;
121 fronbniusNorm_v = text.fronbniusNorm_v;
127 normal_Cam_optim =
new double[3];
128 X0_2_optim =
new double[3];
129 vbase_u_optim =
new double[3];
130 vbase_v_optim =
new double[3];
131 Xinter_optim =
new double[3];
133 colorI = text.colorI;
134 interp = text.interp;
135 bgColor = text.bgColor;
136 cleanPrevImage = text.cleanPrevImage;
137 setBackgroundTexture =
false;
147 delete[] normal_Cam_optim;
149 delete[] vbase_u_optim;
150 delete[] vbase_v_optim;
151 delete[] Xinter_optim;
156 for (
unsigned int i = 0; i < 4; i++) {
164 bgColor = sim.bgColor;
165 cleanPrevImage = sim.cleanPrevImage;
169 normal_obj = sim.normal_obj;
170 frobeniusNorm_u = sim.frobeniusNorm_u;
171 fronbniusNorm_v = sim.fronbniusNorm_v;
188 if (setBackgroundTexture)
192 if (cleanPrevImage) {
193 unsigned char col = (
unsigned char)(0.2126 * bgColor.
R + 0.7152 * bgColor.
G + 0.0722 * bgColor.
B);
194 for (
unsigned int i = 0; i < I.
getHeight(); i++) {
195 for (
unsigned int j = 0; j < I.
getWidth(); j++) {
208 double top = rect.
getTop();
213 unsigned char *bitmap = I.
bitmap;
217 for (
unsigned int i = (
unsigned int)top; i < (
unsigned int)bottom; i++) {
218 for (
unsigned int j = (
unsigned int)left; j < (
unsigned int)right; j++) {
224 unsigned char Ipixelplan = 0;
225 if (getPixel(ip, Ipixelplan)) {
226 *(bitmap + i * width + j) = Ipixelplan;
231 if (getPixel(ip, Ipixelplan)) {
232 unsigned char pixelgrey =
233 (
unsigned char)(0.2126 * Ipixelplan.
R + 0.7152 * Ipixelplan.
G + 0.0722 * Ipixelplan.
B);
234 *(bitmap + i * width + j) = pixelgrey;
253 if (cleanPrevImage) {
254 unsigned char col = (
unsigned char)(0.2126 * bgColor.
R + 0.7152 * bgColor.
G + 0.0722 * bgColor.
B);
255 for (
unsigned int i = 0; i < I.
getHeight(); i++) {
256 for (
unsigned int j = 0; j < I.
getWidth(); j++) {
267 double top = rect.
getTop();
272 unsigned char *bitmap = I.
bitmap;
276 for (
unsigned int i = (
unsigned int)top; i < (
unsigned int)bottom; i++) {
277 for (
unsigned int j = (
unsigned int)left; j < (
unsigned int)right; j++) {
282 unsigned char Ipixelplan = 0;
283 if (getPixel(Isrc, ip, Ipixelplan)) {
284 *(bitmap + i * width + j) = Ipixelplan;
310 " zBuffer must have the same size as the image I ! "));
312 if (cleanPrevImage) {
313 unsigned char col = (
unsigned char)(0.2126 * bgColor.
R + 0.7152 * bgColor.
G + 0.0722 * bgColor.
B);
314 for (
unsigned int i = 0; i < I.
getHeight(); i++) {
315 for (
unsigned int j = 0; j < I.
getWidth(); j++) {
326 double top = rect.
getTop();
331 unsigned char *bitmap = I.
bitmap;
335 for (
unsigned int i = (
unsigned int)top; i < (
unsigned int)bottom; i++) {
336 for (
unsigned int j = (
unsigned int)left; j < (
unsigned int)right; j++) {
342 unsigned char Ipixelplan;
343 if (getPixel(ip, Ipixelplan)) {
344 if (Xinter_optim[2] < zBuffer[i][j] || zBuffer[i][j] < 0) {
345 *(bitmap + i * width + j) = Ipixelplan;
346 zBuffer[i][j] = Xinter_optim[2];
352 if (getPixel(ip, Ipixelplan)) {
353 if (Xinter_optim[2] < zBuffer[i][j] || zBuffer[i][j] < 0) {
354 unsigned char pixelgrey =
355 (
unsigned char)(0.2126 * Ipixelplan.
R + 0.7152 * Ipixelplan.
G + 0.0722 * Ipixelplan.
B);
356 *(bitmap + i * width + j) = pixelgrey;
357 zBuffer[i][j] = Xinter_optim[2];
375 if (cleanPrevImage) {
376 for (
unsigned int i = 0; i < I.
getHeight(); i++) {
377 for (
unsigned int j = 0; j < I.
getWidth(); j++) {
389 double top = rect.
getTop();
398 for (
unsigned int i = (
unsigned int)top; i < (
unsigned int)bottom; i++) {
399 for (
unsigned int j = (
unsigned int)left; j < (
unsigned int)right; j++) {
405 unsigned char Ipixelplan;
406 if (getPixel(ip, Ipixelplan)) {
408 pixelcolor.
R = Ipixelplan;
409 pixelcolor.
G = Ipixelplan;
410 pixelcolor.
B = Ipixelplan;
411 *(bitmap + i * width + j) = pixelcolor;
416 if (getPixel(ip, Ipixelplan)) {
417 *(bitmap + i * width + j) = Ipixelplan;
436 if (cleanPrevImage) {
437 for (
unsigned int i = 0; i < I.
getHeight(); i++) {
438 for (
unsigned int j = 0; j < I.
getWidth(); j++) {
450 double top = rect.
getTop();
459 for (
unsigned int i = (
unsigned int)top; i < (
unsigned int)bottom; i++) {
460 for (
unsigned int j = (
unsigned int)left; j < (
unsigned int)right; j++) {
466 if (getPixel(Isrc, ip, Ipixelplan)) {
467 *(bitmap + i * width + j) = Ipixelplan;
493 " zBuffer must have the same size as the image I ! "));
495 if (cleanPrevImage) {
496 for (
unsigned int i = 0; i < I.
getHeight(); i++) {
497 for (
unsigned int j = 0; j < I.
getWidth(); j++) {
508 double top = rect.
getTop();
517 for (
unsigned int i = (
unsigned int)top; i < (
unsigned int)bottom; i++) {
518 for (
unsigned int j = (
unsigned int)left; j < (
unsigned int)right; j++) {
524 unsigned char Ipixelplan;
525 if (getPixel(ip, Ipixelplan)) {
526 if (Xinter_optim[2] < zBuffer[i][j] || zBuffer[i][j] < 0) {
528 pixelcolor.
R = Ipixelplan;
529 pixelcolor.
G = Ipixelplan;
530 pixelcolor.
B = Ipixelplan;
531 *(bitmap + i * width + j) = pixelcolor;
532 zBuffer[i][j] = Xinter_optim[2];
538 if (getPixel(ip, Ipixelplan)) {
539 if (Xinter_optim[2] < zBuffer[i][j] || zBuffer[i][j] < 0) {
540 *(bitmap + i * width + j) = Ipixelplan;
541 zBuffer[i][j] = Xinter_optim[2];
664 unsigned int nbsimList = (
unsigned int)list.size();
671 double topFinal = height + 1;
673 double bottomFinal = -1;
674 double leftFinal = width + 1;
675 double rightFinal = -1;
677 unsigned int unvisible = 0;
678 unsigned int indexSimu = 0;
679 for (std::list<vpImageSimulator>::iterator it = list.begin(); it != list.end(); ++it, ++indexSimu) {
682 simList[indexSimu] = sim;
686 nbsimList = nbsimList - unvisible;
693 for (
unsigned int i = 0; i < nbsimList; i++) {
694 if (!simList[i]->needClipping)
695 simList[i]->getRoi(width, height, cam, simList[i]->pt, simList[i]->rect);
697 simList[i]->getRoi(width, height, cam, simList[i]->ptClipped, simList[i]->rect);
699 if (topFinal > simList[i]->rect.
getTop())
700 topFinal = simList[i]->rect.
getTop();
701 if (bottomFinal < simList[i]->rect.
getBottom())
702 bottomFinal = simList[i]->rect.
getBottom();
703 if (leftFinal > simList[i]->rect.
getLeft())
704 leftFinal = simList[i]->rect.
getLeft();
705 if (rightFinal < simList[i]->rect.
getRight())
706 rightFinal = simList[i]->rect.
getRight();
711 unsigned char *bitmap = I.
bitmap;
714 for (
unsigned int i = (
unsigned int)topFinal; i < (
unsigned int)bottomFinal; i++) {
715 for (
unsigned int j = (
unsigned int)leftFinal; j < (
unsigned int)rightFinal; j++) {
721 for (
int k = 0; k < (int)nbsimList; k++) {
723 if (simList[k]->getPixelDepth(ip, z)) {
724 if (z < zmin || zmin < 0) {
732 unsigned char Ipixelplan = 255;
733 simList[indice]->getPixel(ip, Ipixelplan);
734 *(bitmap + i * width + j) = Ipixelplan;
736 else if (simList[indice]->colorI ==
COLORED) {
737 vpRGBa Ipixelplan(255, 255, 255);
738 simList[indice]->getPixel(ip, Ipixelplan);
739 unsigned char pixelgrey =
740 (
unsigned char)(0.2126 * Ipixelplan.
R + 0.7152 * Ipixelplan.
G + 0.0722 * Ipixelplan.
B);
741 *(bitmap + i * width + j) = pixelgrey;
865 unsigned int nbsimList = (
unsigned int)list.size();
872 double topFinal = height + 1;
874 double bottomFinal = -1;
875 double leftFinal = width + 1;
876 double rightFinal = -1;
878 unsigned int unvisible = 0;
879 unsigned int indexSimu = 0;
880 for (std::list<vpImageSimulator>::iterator it = list.begin(); it != list.end(); ++it, ++indexSimu) {
883 simList[indexSimu] = sim;
888 nbsimList = nbsimList - unvisible;
895 for (
unsigned int i = 0; i < nbsimList; i++) {
896 if (!simList[i]->needClipping)
897 simList[i]->getRoi(width, height, cam, simList[i]->pt, simList[i]->rect);
899 simList[i]->getRoi(width, height, cam, simList[i]->ptClipped, simList[i]->rect);
901 if (topFinal > simList[i]->rect.
getTop())
902 topFinal = simList[i]->rect.
getTop();
903 if (bottomFinal < simList[i]->rect.
getBottom())
904 bottomFinal = simList[i]->rect.
getBottom();
905 if (leftFinal > simList[i]->rect.
getLeft())
906 leftFinal = simList[i]->rect.
getLeft();
907 if (rightFinal < simList[i]->rect.
getRight())
908 rightFinal = simList[i]->rect.
getRight();
916 for (
unsigned int i = (
unsigned int)topFinal; i < (
unsigned int)bottomFinal; i++) {
917 for (
unsigned int j = (
unsigned int)leftFinal; j < (
unsigned int)rightFinal; j++) {
923 for (
int k = 0; k < (int)nbsimList; k++) {
925 if (simList[k]->getPixelDepth(ip, z)) {
926 if (z < zmin || zmin < 0) {
934 unsigned char Ipixelplan = 255;
935 simList[indice]->getPixel(ip, Ipixelplan);
937 pixelcolor.
R = Ipixelplan;
938 pixelcolor.
G = Ipixelplan;
939 pixelcolor.
B = Ipixelplan;
940 *(bitmap + i * width + j) = pixelcolor;
942 else if (simList[indice]->colorI ==
COLORED) {
943 vpRGBa Ipixelplan(255, 255, 255);
944 simList[indice]->getPixel(ip, Ipixelplan);
947 *(bitmap + i * width + j) = Ipixelplan;
966 needClipping =
false;
968 normal_Cam = R * normal_obj;
972 for (
unsigned int i = 0; i < 4; i++)
979 e1[0] = pt[1].get_X() - pt[0].get_X();
980 e1[1] = pt[1].get_Y() - pt[0].get_Y();
981 e1[2] = pt[1].get_Z() - pt[0].get_Z();
983 e2[0] = pt[2].get_X() - pt[1].get_X();
984 e2[1] = pt[2].get_Y() - pt[1].get_Y();
985 e2[2] = pt[2].get_Z() - pt[1].get_Z();
989 double angle = pt[0].get_X() * facenormal[0] + pt[0].get_Y() * facenormal[1] + pt[0].get_Z() * facenormal[2];
999 for (
unsigned int i = 0; i < 4; i++) {
1000 project(X[i], cMt, X2[i]);
1002 if (pt[i].get_Z() < 0)
1003 needClipping =
true;
1006 vbase_u = X2[1] - X2[0];
1007 vbase_v = X2[3] - X2[0];
1016 for (
unsigned int i = 0; i < 3; i++) {
1017 normal_Cam_optim[i] = normal_Cam[i];
1018 X0_2_optim[i] = X2[0][i];
1019 vbase_u_optim[i] = vbase_u[i];
1020 vbase_v_optim[i] = vbase_v[i];
1023 std::vector<vpPoint> *ptPtr = &pt;
1029 listTriangle.clear();
1030 for (
unsigned int i = 1; i < (*ptPtr).size() - 1; i++) {
1032 ip1.
set_j((*ptPtr)[0].get_x());
1033 ip1.
set_i((*ptPtr)[0].get_y());
1035 ip2.
set_j((*ptPtr)[i].get_x());
1036 ip2.
set_i((*ptPtr)[i].get_y());
1038 ip3.
set_j((*ptPtr)[i + 1].get_x());
1039 ip3.
set_i((*ptPtr)[i + 1].get_y());
1042 listTriangle.push_back(tri);
1049 for (
unsigned int i = 0; i < 4; i++) {
1051 pt[i].setWorldCoordinates(X_[i][0], X_[i][1], X_[i][2]);
1057 frobeniusNorm_u = (X[1] - X[0]).frobeniusNorm();
1058 fronbniusNorm_v = (X[3] - X[0]).frobeniusNorm();
1103 #ifdef VISP_HAVE_MODULE_IO
1144 if (X_.size() != 4) {
1148 for (
unsigned int i = 0; i < 4; ++i) {
1150 Xvec[i][0] = X_[i].get_oX();
1151 Xvec[i][1] = X_[i].get_oY();
1152 Xvec[i][2] = X_[i].get_oZ();
1176 if (X_.size() != 4) {
1180 for (
unsigned int i = 0; i < 4; ++i) {
1182 Xvec[i][0] = X_[i].get_oX();
1183 Xvec[i][1] = X_[i].get_oY();
1184 Xvec[i][2] = X_[i].get_oZ();
1192 #ifdef VISP_HAVE_MODULE_IO
1211 if (X_.size() != 4) {
1215 for (
unsigned int i = 0; i < 4; ++i) {
1217 Xvec[i][0] = X_[i].get_oX();
1218 Xvec[i][1] = X_[i].get_oY();
1219 Xvec[i][2] = X_[i].get_oZ();
1228 bool vpImageSimulator::getPixel(
const vpImagePoint &iP,
unsigned char &Ipixelplan)
1232 bool inside =
false;
1233 for (
unsigned int i = 0; i < listTriangle.size(); i++)
1234 if (listTriangle[i].inTriangle(iP)) {
1250 z = distance / (normal_Cam_optim[0] * iP.
get_u() + normal_Cam_optim[1] * iP.
get_v() + normal_Cam_optim[2]);
1252 Xinter_optim[0] = iP.
get_u() * z;
1253 Xinter_optim[1] = iP.
get_v() * z;
1254 Xinter_optim[2] = z;
1262 double u = 0, v = 0;
1263 for (
unsigned int i = 0; i < 3; i++) {
1264 double diff = (Xinter_optim[i] - X0_2_optim[i]);
1265 u += diff * vbase_u_optim[i];
1266 v += diff * vbase_v_optim[i];
1268 u = u / (frobeniusNorm_u * frobeniusNorm_u);
1269 v = v / (fronbniusNorm_v * fronbniusNorm_v);
1271 if (u > 0 && v > 0 && u < 1. && v < 1.) {
1277 else if (interp ==
SIMPLE)
1278 Ipixelplan = Ig[(
unsigned int)i2][(
unsigned int)j2];
1288 bool inside =
false;
1289 for (
unsigned int i = 0; i < listTriangle.size(); i++)
1290 if (listTriangle[i].inTriangle(iP)) {
1304 z = distance / (normal_Cam_optim[0] * iP.
get_u() + normal_Cam_optim[1] * iP.
get_v() + normal_Cam_optim[2]);
1306 Xinter_optim[0] = iP.
get_u() * z;
1307 Xinter_optim[1] = iP.
get_v() * z;
1308 Xinter_optim[2] = z;
1316 double u = 0, v = 0;
1317 for (
unsigned int i = 0; i < 3; i++) {
1318 double diff = (Xinter_optim[i] - X0_2_optim[i]);
1319 u += diff * vbase_u_optim[i];
1320 v += diff * vbase_v_optim[i];
1322 u = u / (frobeniusNorm_u * frobeniusNorm_u);
1323 v = v / (fronbniusNorm_v * fronbniusNorm_v);
1325 if (u > 0 && v > 0 && u < 1. && v < 1.) {
1330 Ipixelplan = Isrc.
getValue(i2, j2);
1331 else if (interp ==
SIMPLE)
1332 Ipixelplan = Isrc[(
unsigned int)i2][(
unsigned int)j2];
1342 bool inside =
false;
1343 for (
unsigned int i = 0; i < listTriangle.size(); i++)
1344 if (listTriangle[i].inTriangle(iP)) {
1357 z = distance / (normal_Cam_optim[0] * iP.
get_u() + normal_Cam_optim[1] * iP.
get_v() + normal_Cam_optim[2]);
1359 Xinter_optim[0] = iP.
get_u() * z;
1360 Xinter_optim[1] = iP.
get_v() * z;
1361 Xinter_optim[2] = z;
1369 double u = 0, v = 0;
1370 for (
unsigned int i = 0; i < 3; i++) {
1371 double diff = (Xinter_optim[i] - X0_2_optim[i]);
1372 u += diff * vbase_u_optim[i];
1373 v += diff * vbase_v_optim[i];
1375 u = u / (frobeniusNorm_u * frobeniusNorm_u);
1376 v = v / (fronbniusNorm_v * fronbniusNorm_v);
1378 if (u > 0 && v > 0 && u < 1. && v < 1.) {
1384 else if (interp ==
SIMPLE)
1385 Ipixelplan = Ic[(
unsigned int)i2][(
unsigned int)j2];
1397 bool inside =
false;
1398 for (
unsigned int i = 0; i < listTriangle.size(); i++)
1399 if (listTriangle[i].inTriangle(iP)) {
1410 z = distance / (normal_Cam_optim[0] * iP.
get_u() + normal_Cam_optim[1] * iP.
get_v() + normal_Cam_optim[2]);
1412 Xinter_optim[0] = iP.
get_u() * z;
1413 Xinter_optim[1] = iP.
get_v() * z;
1414 Xinter_optim[2] = z;
1422 double u = 0, v = 0;
1423 for (
unsigned int i = 0; i < 3; i++) {
1424 double diff = (Xinter_optim[i] - X0_2_optim[i]);
1425 u += diff * vbase_u_optim[i];
1426 v += diff * vbase_v_optim[i];
1428 u = u / (frobeniusNorm_u * frobeniusNorm_u);
1429 v = v / (fronbniusNorm_v * fronbniusNorm_v);
1431 if (u > 0 && v > 0 && u < 1. && v < 1.) {
1436 Ipixelplan = Isrc.
getValue(i2, j2);
1437 else if (interp ==
SIMPLE)
1438 Ipixelplan = Isrc[(
unsigned int)i2][(
unsigned int)j2];
1445 bool vpImageSimulator::getPixelDepth(
const vpImagePoint &iP,
double &Zpixelplan)
1448 bool inside =
false;
1449 for (
unsigned int i = 0; i < listTriangle.size(); i++)
1450 if (listTriangle[i].inTriangle(iP)) {
1459 Zpixelplan = distance / (normal_Cam_optim[0] * iP.
get_u() + normal_Cam_optim[1] * iP.
get_v() + normal_Cam_optim[2]);
1463 bool vpImageSimulator::getPixelVisibility(
const vpImagePoint &iP,
double &Visipixelplan)
1466 bool inside =
false;
1467 for (
unsigned int i = 0; i < listTriangle.size(); i++)
1468 if (listTriangle[i].inTriangle(iP)) {
1477 Visipixelplan = visible_result;
1484 getHomogCoord(_vin, XH);
1485 getCoordFromHomog(_cMt * XH, _vout);
1490 for (
unsigned int i = 0; i < 3; i++)
1497 for (
unsigned int i = 0; i < 3; i++)
1498 _v[i] = _vH[i] / _vH[3];
1501 void vpImageSimulator::getRoi(
const unsigned int &Iwidth,
const unsigned int &Iheight,
const vpCameraParameters &cam,
1502 const std::vector<vpPoint> &point,
vpRect &rectangle)
1504 double top = Iheight + 1;
1507 double left = Iwidth + 1;
1509 for (
unsigned int i = 0; i < point.size(); i++) {
1510 double u = 0, v = 0;
1527 if (bottom >= Iheight)
1528 bottom = Iheight - 1;
1535 if (right >= Iwidth)
1546 std::vector<vpColVector> X_;
1547 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)
VP_EXPLICIT 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.