Visual Servoing Platform  version 3.0.0
vpImageSimulator.cpp
1 /****************************************************************************
2  *
3  * This file is part of the ViSP software.
4  * Copyright (C) 2005 - 2015 by Inria. All rights reserved.
5  *
6  * This software is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * ("GPL") version 2 as published by the Free Software Foundation.
9  * See the file LICENSE.txt at the root directory of this source
10  * distribution for additional information about the GNU GPL.
11  *
12  * For using ViSP with software that can not be combined with the GNU
13  * GPL, please contact Inria about acquiring a ViSP Professional
14  * Edition License.
15  *
16  * See http://visp.inria.fr for more information.
17  *
18  * This software was developed at:
19  * Inria Rennes - Bretagne Atlantique
20  * Campus Universitaire de Beaulieu
21  * 35042 Rennes Cedex
22  * France
23  *
24  * If you have questions regarding the use of this file, please contact
25  * Inria at visp@inria.fr
26  *
27  * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
28  * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
29  *
30  * Description: Class which enables to project an image in the 3D space
31  * and get the view of a virtual camera.
32  *
33  * Authors:
34  * Amaury Dame
35  * Nicolas Melchior
36  *
37  *****************************************************************************/
38 
39 #include <visp3/robot/vpImageSimulator.h>
40 #include <visp3/core/vpRotationMatrix.h>
41 #include <visp3/core/vpImageConvert.h>
42 #include <visp3/core/vpPixelMeterConversion.h>
43 #include <visp3/core/vpMeterPixelConversion.h>
44 #include <visp3/core/vpMatrixException.h>
45 #include <visp3/core/vpPolygon3D.h>
46 
47 #ifdef VISP_HAVE_MODULE_IO
48 # include <visp3/io/vpImageIo.h>
49 #endif
50 
61  : cMt(), pt(), ptClipped(), interp(SIMPLE), normal_obj(), normal_Cam(), normal_Cam_optim(),
62  distance(1.), visible_result(1.), visible(false), X0_2_optim(NULL),
63  euclideanNorm_u(0.), euclideanNorm_v(0.), vbase_u(), vbase_v(),
64  vbase_u_optim(NULL), vbase_v_optim(NULL), Xinter_optim(NULL), listTriangle(),
65  colorI(col), Ig(), Ic(), rect(), cleanPrevImage(false),
66  setBackgroundTexture(false), bgColor(vpColor::white), focal(), needClipping(false)
67 {
68  for(int i=0;i<4;i++)
69  X[i].resize(3);
70 
71  for(int i=0;i<4;i++)
72  X2[i].resize(3);
73 
74  normal_obj.resize(3);
75  visible=false;
76  normal_Cam.resize(3);
77 
78  //Xinter.resize(3);
79 
80  vbase_u.resize(3);
81  vbase_v.resize(3);
82 
83  focal.resize(3);
84  focal=0;
85  focal[2]=1;
86 
87  normal_Cam_optim = new double[3];
88  X0_2_optim = new double[3];
89  vbase_u_optim = new double[3];
90  vbase_v_optim = new double[3];
91  Xinter_optim = new double[3];
92 
93  pt.resize(4);
94 }
95 
96 
101  : cMt(), pt(), ptClipped(), interp(SIMPLE), normal_obj(), normal_Cam(), normal_Cam_optim(),
102  distance(1.), visible_result(1.), visible(false), X0_2_optim(NULL),
103  euclideanNorm_u(0.), euclideanNorm_v(0.), vbase_u(), vbase_v(),
104  vbase_u_optim(NULL), vbase_v_optim(NULL), Xinter_optim(NULL), listTriangle(),
105  colorI(GRAY_SCALED), Ig(), Ic(), rect(), cleanPrevImage(false),
106  setBackgroundTexture(false), bgColor(vpColor::white), focal(), needClipping(false)
107 {
108  pt.resize(4);
109  for(unsigned int i=0;i<4;i++)
110  {
111  X[i] = text.X[i];
112  pt[i] = text.pt[i];
113  }
114 
115  for(int i=0;i<4;i++)
116  X2[i].resize(3);
117 
118  Ic = text.Ic;
119  Ig = text.Ig;
120 
121  focal.resize(3);
122  focal=0;
123  focal[2]=1;
124 
125  normal_obj = text.normal_obj;
126  euclideanNorm_u = text.euclideanNorm_u;
127  euclideanNorm_v = text.euclideanNorm_v;
128 
129  normal_Cam.resize(3);
130  vbase_u.resize(3);
131  vbase_v.resize(3);
132 
133 
134  normal_Cam_optim = new double[3];
135  X0_2_optim = new double[3];
136  vbase_u_optim = new double[3];
137  vbase_v_optim = new double[3];
138  Xinter_optim = new double[3];
139 
140  colorI = text.colorI;
141  interp = text.interp;
142  bgColor = text.bgColor;
143  cleanPrevImage = text.cleanPrevImage;
144  setBackgroundTexture = false;
145 
146  setCameraPosition(text.cMt);
147 }
148 
153 {
154  delete[] normal_Cam_optim;
155  delete[] X0_2_optim;
156  delete[] vbase_u_optim;
157  delete[] vbase_v_optim;
158  delete[] Xinter_optim;
159 }
160 
161 
164 {
165  for(unsigned int i=0;i<4;i++)
166  {
167  X[i] = sim.X[i];
168  pt[i] = sim.pt[i];
169  }
170 
171  Ic = sim.Ic;
172  Ig = sim.Ig;
173 
174  bgColor = sim.bgColor;
175  cleanPrevImage = sim.cleanPrevImage;
176 
177  focal = sim.focal;
178 
179  normal_obj = sim.normal_obj;
180  euclideanNorm_u = sim.euclideanNorm_u;
181  euclideanNorm_v = sim.euclideanNorm_v;
182 
183  colorI = sim.colorI;
184  interp = sim.interp;
185 
186  setCameraPosition(sim.cMt);
187 
188  return *this;
189 }
190 
196 void
198  const vpCameraParameters &cam)
199 {
200  int nb_point_dessine = 0;
201  if (setBackgroundTexture)
202  // The Ig has been set to a previously defined background texture
203  I = Ig;
204  else
205  {
206  if (cleanPrevImage)
207  {
208  unsigned char col = (unsigned char) (0.2126 * bgColor.R
209  + 0.7152 * bgColor.G + 0.0722 * bgColor.B);
210  for (unsigned int i = 0; i < I.getHeight(); i++)
211  {
212  for (unsigned int j = 0; j < I.getWidth(); j++)
213  {
214  I[i][j] = col;
215  }
216  }
217  }
218  }
219 
220  if(visible)
221  {
222  if(!needClipping)
223  getRoi(I.getWidth(),I.getHeight(),cam,pt,rect);
224  else
225  getRoi(I.getWidth(),I.getHeight(),cam,ptClipped,rect);
226 
227  double top = rect.getTop();
228  double bottom = rect.getBottom();
229  double left = rect.getLeft();
230  double right= rect.getRight();
231 
232  unsigned char *bitmap = I.bitmap;
233  unsigned int width = I.getWidth();
234  vpImagePoint ip;
235 
236  for (unsigned int i = (unsigned int)top; i < (unsigned int)bottom; i++)
237  {
238  for (unsigned int j = (unsigned int)left; j < (unsigned int)right; j++)
239  {
240  double x=0,y=0;
241  ip.set_ij(i,j);
243  ip.set_ij(y,x);
244  if (colorI == GRAY_SCALED)
245  {
246  unsigned char Ipixelplan = 0;
247  if(getPixel(ip,Ipixelplan))
248  {
249  *(bitmap+i*width+j)=Ipixelplan;
250  nb_point_dessine++;
251  }
252  }
253  else if (colorI == COLORED)
254  {
255  vpRGBa Ipixelplan;
256  if(getPixel(ip,Ipixelplan))
257  {
258  unsigned char pixelgrey = (unsigned char)(0.2126 * Ipixelplan.R + 0.7152 * Ipixelplan.G + 0.0722 * Ipixelplan.B);
259  *(bitmap+i*width+j)=pixelgrey;
260  nb_point_dessine++;
261  }
262  }
263  }
264  }
265  }
266 }
267 
268 
276 void
279  const vpCameraParameters &cam)
280 {
281  int nb_point_dessine = 0;
282  if (cleanPrevImage)
283  {
284  unsigned char col = (unsigned char)(0.2126 * bgColor.R + 0.7152 * bgColor.G + 0.0722 * bgColor.B);
285  for (unsigned int i = 0; i < I.getHeight(); i++)
286  {
287  for (unsigned int j = 0; j < I.getWidth(); j++)
288  {
289  I[i][j] = col;
290  }
291  }
292  }
293  if(visible)
294  {
295  if(!needClipping)
296  getRoi(I.getWidth(),I.getHeight(),cam,pt,rect);
297  else
298  getRoi(I.getWidth(),I.getHeight(),cam,ptClipped,rect);
299 
300  double top = rect.getTop();
301  double bottom = rect.getBottom();
302  double left = rect.getLeft();
303  double right= rect.getRight();
304 
305  unsigned char *bitmap = I.bitmap;
306  unsigned int width = I.getWidth();
307  vpImagePoint ip;
308 
309  for (unsigned int i = (unsigned int)top; i < (unsigned int)bottom; i++)
310  {
311  for (unsigned int j = (unsigned int)left; j < (unsigned int)right; j++)
312  {
313  double x=0,y=0;
314  ip.set_ij(i,j);
316  ip.set_ij(y,x);
317  unsigned char Ipixelplan = 0;
318  if(getPixel(Isrc,ip,Ipixelplan))
319  {
320  *(bitmap+i*width+j)=Ipixelplan;
321  nb_point_dessine++;
322  }
323  }
324  }
325  }
326 }
327 
337 void
339  const vpCameraParameters &cam, vpMatrix &zBuffer)
340 {
341  if (I.getWidth() != (unsigned int)zBuffer.getCols() || I.getHeight() != (unsigned int)zBuffer.getRows())
342  throw (vpMatrixException(vpMatrixException::incorrectMatrixSizeError, " zBuffer must have the same size as the image I ! "));
343 
344  int nb_point_dessine = 0;
345  if (cleanPrevImage)
346  {
347  unsigned char col = (unsigned char)(0.2126 * bgColor.R + 0.7152 * bgColor.G + 0.0722 * bgColor.B);
348  for (unsigned int i = 0; i < I.getHeight(); i++)
349  {
350  for (unsigned int j = 0; j < I.getWidth(); j++)
351  {
352  I[i][j] = col;
353  }
354  }
355  }
356  if(visible)
357  {
358  if(!needClipping)
359  getRoi(I.getWidth(),I.getHeight(),cam,pt,rect);
360  else
361  getRoi(I.getWidth(),I.getHeight(),cam,ptClipped,rect);
362 
363  double top = rect.getTop();
364  double bottom = rect.getBottom();
365  double left = rect.getLeft();
366  double right= rect.getRight();
367 
368  unsigned char *bitmap = I.bitmap;
369  unsigned int width = I.getWidth();
370  vpImagePoint ip;
371 
372  for (unsigned int i = (unsigned int)top; i < (unsigned int)bottom; i++)
373  {
374  for (unsigned int j = (unsigned int)left; j < (unsigned int)right; j++)
375  {
376  double x=0,y=0;
377  ip.set_ij(i,j);
379  ip.set_ij(y,x);
380  if (colorI == GRAY_SCALED)
381  {
382  unsigned char Ipixelplan;
383  if(getPixel(ip,Ipixelplan))
384  {
385  if (Xinter_optim[2] < zBuffer[i][j] || zBuffer[i][j] < 0)
386  {
387  *(bitmap+i*width+j)=Ipixelplan;
388  nb_point_dessine++;
389  zBuffer[i][j] = Xinter_optim[2];
390  }
391  }
392  }
393  else if (colorI == COLORED)
394  {
395  vpRGBa Ipixelplan;
396  if(getPixel(ip,Ipixelplan))
397  {
398  if (Xinter_optim[2] < zBuffer[i][j] || zBuffer[i][j] < 0)
399  {
400  unsigned char pixelgrey = (unsigned char)(0.2126 * Ipixelplan.R + 0.7152 * Ipixelplan.G + 0.0722 * Ipixelplan.B);
401  *(bitmap+i*width+j)=pixelgrey;
402  nb_point_dessine++;
403  zBuffer[i][j] = Xinter_optim[2];
404  }
405  }
406  }
407  }
408  }
409  }
410 }
411 
418 void
420 {
421  int nb_point_dessine = 0;
422  if (cleanPrevImage)
423  {
424  for (unsigned int i = 0; i < I.getHeight(); i++)
425  {
426  for (unsigned int j = 0; j < I.getWidth(); j++)
427  {
428  I[i][j] = bgColor;
429  }
430  }
431  }
432 
433  if(visible)
434  {
435  if(!needClipping)
436  getRoi(I.getWidth(),I.getHeight(),cam,pt,rect);
437  else
438  getRoi(I.getWidth(),I.getHeight(),cam,ptClipped,rect);
439 
440  double top = rect.getTop();
441  double bottom = rect.getBottom();
442  double left = rect.getLeft();
443  double right= rect.getRight();
444 
445  vpRGBa *bitmap = I.bitmap;
446  unsigned int width = I.getWidth();
447  vpImagePoint ip;
448 
449  for (unsigned int i = (unsigned int)top; i < (unsigned int)bottom; i++)
450  {
451  for (unsigned int j = (unsigned int)left; j < (unsigned int)right; j++)
452  {
453  double x=0,y=0;
454  ip.set_ij(i,j);
456  ip.set_ij(y,x);
457  if (colorI == GRAY_SCALED)
458  {
459  unsigned char Ipixelplan;
460  if(getPixel(ip,Ipixelplan))
461  {
462  vpRGBa pixelcolor;
463  pixelcolor.R = Ipixelplan;
464  pixelcolor.G = Ipixelplan;
465  pixelcolor.B = Ipixelplan;
466  *(bitmap+i*width+j) = pixelcolor;
467  nb_point_dessine++;
468  }
469  }
470  else if (colorI == COLORED)
471  {
472  vpRGBa Ipixelplan;
473  if(getPixel(ip,Ipixelplan))
474  {
475  *(bitmap+i*width+j) = Ipixelplan;
476  nb_point_dessine++;
477  }
478  }
479  }
480  }
481  }
482 }
483 
484 
492 void
494  const vpCameraParameters &cam)
495 {
496  int nb_point_dessine = 0;
497  if (cleanPrevImage)
498  {
499  for (unsigned int i = 0; i < I.getHeight(); i++)
500  {
501  for (unsigned int j = 0; j < I.getWidth(); j++)
502  {
503  I[i][j] = bgColor;
504  }
505  }
506  }
507 
508  if(visible)
509  {
510  if(!needClipping)
511  getRoi(I.getWidth(),I.getHeight(),cam,pt,rect);
512  else
513  getRoi(I.getWidth(),I.getHeight(),cam,ptClipped,rect);
514 
515  double top = rect.getTop();
516  double bottom = rect.getBottom();
517  double left = rect.getLeft();
518  double right= rect.getRight();
519 
520  vpRGBa *bitmap = I.bitmap;
521  unsigned int width = I.getWidth();
522  vpImagePoint ip;
523 
524  for (unsigned int i = (unsigned int)top; i < (unsigned int)bottom; i++)
525  {
526  for (unsigned int j = (unsigned int)left; j < (unsigned int)right; j++)
527  {
528  double x=0,y=0;
529  ip.set_ij(i,j);
531  ip.set_ij(y,x);
532  vpRGBa Ipixelplan;
533  if(getPixel(Isrc,ip,Ipixelplan))
534  {
535  *(bitmap+i*width+j) = Ipixelplan;
536  nb_point_dessine++;
537  }
538  }
539  }
540  }
541 }
542 
552 void
554  vpMatrix &zBuffer)
555 {
556  if (I.getWidth() != (unsigned int)zBuffer.getCols() || I.getHeight() != (unsigned int)zBuffer.getRows())
557  throw (vpMatrixException(vpMatrixException::incorrectMatrixSizeError, " zBuffer must have the same size as the image I ! "));
558 
559  int nb_point_dessine = 0;
560  if (cleanPrevImage)
561  {
562  for (unsigned int i = 0; i < I.getHeight(); i++)
563  {
564  for (unsigned int j = 0; j < I.getWidth(); j++)
565  {
566  I[i][j] = bgColor;
567  }
568  }
569  }
570  if(visible)
571  {
572  if(!needClipping)
573  getRoi(I.getWidth(),I.getHeight(),cam,pt,rect);
574  else
575  getRoi(I.getWidth(),I.getHeight(),cam,ptClipped,rect);
576 
577  double top = rect.getTop();
578  double bottom = rect.getBottom();
579  double left = rect.getLeft();
580  double right= rect.getRight();
581 
582  vpRGBa *bitmap = I.bitmap;
583  unsigned int width = I.getWidth();
584  vpImagePoint ip;
585 
586  for (unsigned int i = (unsigned int)top; i < (unsigned int)bottom; i++)
587  {
588  for (unsigned int j = (unsigned int)left; j < (unsigned int)right; j++)
589  {
590  double x=0,y=0;
591  ip.set_ij(i,j);
593  ip.set_ij(y,x);
594  if (colorI == GRAY_SCALED)
595  {
596  unsigned char Ipixelplan;
597  if(getPixel(ip,Ipixelplan))
598  {
599  if (Xinter_optim[2] < zBuffer[i][j] || zBuffer[i][j] < 0)
600  {
601  vpRGBa pixelcolor;
602  pixelcolor.R = Ipixelplan;
603  pixelcolor.G = Ipixelplan;
604  pixelcolor.B = Ipixelplan;
605  *(bitmap+i*width+j) = pixelcolor;
606  nb_point_dessine++;
607  zBuffer[i][j] = Xinter_optim[2];
608  }
609  }
610  }
611  else if (colorI == COLORED)
612  {
613  vpRGBa Ipixelplan;
614  if(getPixel(ip,Ipixelplan))
615  {
616  if (Xinter_optim[2] < zBuffer[i][j] || zBuffer[i][j] < 0)
617  {
618  *(bitmap+i*width+j) = Ipixelplan;
619  nb_point_dessine++;
620  zBuffer[i][j] = Xinter_optim[2];
621  }
622  }
623  }
624  }
625  }
626  }
627 }
628 
729 void
731  std::list<vpImageSimulator> &list,
732  const vpCameraParameters &cam)
733 {
734 
735  unsigned int width = I.getWidth();
736  unsigned int height = I.getHeight();
737 
738  unsigned int nbsimList = (unsigned int)list.size();
739 
740  if (nbsimList < 1)
741  return;
742 
743  vpImageSimulator** simList = new vpImageSimulator* [nbsimList];
744 
745  double topFinal = height+1;;
746  double bottomFinal = -1;
747  double leftFinal = width+1;
748  double rightFinal = -1;
749 
750  unsigned int unvisible = 0;
751  unsigned int indexSimu=0;
752  for(std::list<vpImageSimulator>::iterator it=list.begin(); it!=list.end(); ++it, ++indexSimu){
753  vpImageSimulator* sim = &(*it);
754  if (sim->visible)
755  simList[indexSimu] = sim;
756  else
757  unvisible++;
758  }
759  nbsimList = nbsimList - unvisible;
760 
761  if (nbsimList < 1)
762  {
763  delete[] simList;
764  return;
765  }
766 
767 
768  for (unsigned int i = 0; i < nbsimList; i++)
769  {
770  if(!simList[i]->needClipping)
771  simList[i]->getRoi(width,height,cam,simList[i]->pt,simList[i]->rect);
772  else
773  simList[i]->getRoi(width,height,cam,simList[i]->ptClipped,simList[i]->rect);
774 
775  if (topFinal > simList[i]->rect.getTop()) topFinal = simList[i]->rect.getTop();
776  if (bottomFinal < simList[i]->rect.getBottom()) bottomFinal = simList[i]->rect.getBottom();
777  if (leftFinal > simList[i]->rect.getLeft()) leftFinal = simList[i]->rect.getLeft();
778  if (rightFinal < simList[i]->rect.getRight()) rightFinal = simList[i]->rect.getRight();
779  }
780 
781  double zmin = -1;
782  int indice = -1;
783  unsigned char *bitmap = I.bitmap;
784  vpImagePoint ip;
785 
786  for (unsigned int i = (unsigned int)topFinal; i < (unsigned int)bottomFinal; i++)
787  {
788  for (unsigned int j = (unsigned int)leftFinal; j < (unsigned int)rightFinal; j++)
789  {
790  zmin = -1;
791  double x=0,y=0;
792  ip.set_ij(i,j);
794  ip.set_ij(y,x);
795  for (int k = 0; k < (int)nbsimList; k++)
796  {
797  double z = 0;
798  if(simList[k]->getPixelDepth(ip,z))
799  {
800  if (z < zmin || zmin < 0)
801  {
802  zmin = z;
803  indice = k;
804  }
805  }
806  }
807  if (indice >= 0)
808  {
809  if (simList[indice]->colorI == GRAY_SCALED)
810  {
811  unsigned char Ipixelplan = 255;
812  simList[indice]->getPixel(ip,Ipixelplan);
813  *(bitmap+i*width+j)=Ipixelplan;
814  }
815  else if (simList[indice]->colorI == COLORED)
816  {
817  vpRGBa Ipixelplan(255,255,255);
818  simList[indice]->getPixel(ip,Ipixelplan);
819  unsigned char pixelgrey = (unsigned char)(0.2126 * Ipixelplan.R + 0.7152 * Ipixelplan.G + 0.0722 * Ipixelplan.B);
820  *(bitmap+i*width+j)=pixelgrey;
821  }
822  }
823  }
824  }
825 
826  delete[] simList;
827 }
828 
829 
931 void
933  std::list<vpImageSimulator> &list,
934  const vpCameraParameters &cam)
935 {
936 
937  unsigned int width = I.getWidth();
938  unsigned int height = I.getHeight();
939 
940  unsigned int nbsimList = (unsigned int)list.size();
941 
942  if (nbsimList < 1)
943  return;
944 
945  vpImageSimulator** simList = new vpImageSimulator* [nbsimList];
946 
947  double topFinal = height+1;;
948  double bottomFinal = -1;
949  double leftFinal = width+1;
950  double rightFinal = -1;
951 
952  unsigned int unvisible = 0;
953  unsigned int indexSimu = 0;
954  for(std::list<vpImageSimulator>::iterator it=list.begin(); it!=list.end(); ++it, ++indexSimu){
955  vpImageSimulator* sim = &(*it);
956  if (sim->visible)
957  simList[indexSimu] = sim;
958  else
959  unvisible++;
960  }
961 
962  nbsimList = nbsimList - unvisible;
963 
964  if (nbsimList < 1)
965  {
966  delete[] simList;
967  return;
968  }
969 
970  for (unsigned int i = 0; i < nbsimList; i++)
971  {
972  if(!simList[i]->needClipping)
973  simList[i]->getRoi(width,height,cam,simList[i]->pt,simList[i]->rect);
974  else
975  simList[i]->getRoi(width,height,cam,simList[i]->ptClipped,simList[i]->rect);
976 
977  if (topFinal > simList[i]->rect.getTop()) topFinal = simList[i]->rect.getTop();
978  if (bottomFinal < simList[i]->rect.getBottom()) bottomFinal = simList[i]->rect.getBottom();
979  if (leftFinal > simList[i]->rect.getLeft()) leftFinal = simList[i]->rect.getLeft();
980  if (rightFinal < simList[i]->rect.getRight()) rightFinal = simList[i]->rect.getRight();
981  }
982 
983  double zmin = -1;
984  int indice = -1;
985  vpRGBa *bitmap = I.bitmap;
986  vpImagePoint ip;
987 
988  for (unsigned int i = (unsigned int)topFinal; i < (unsigned int)bottomFinal; i++)
989  {
990  for (unsigned int j = (unsigned int)leftFinal; j < (unsigned int)rightFinal; j++)
991  {
992  zmin = -1;
993  double x=0,y=0;
994  ip.set_ij(i,j);
996  ip.set_ij(y,x);
997  for (int k = 0; k < (int)nbsimList; k++)
998  {
999  double z = 0;
1000  if(simList[k]->getPixelDepth(ip,z))
1001  {
1002  if (z < zmin || zmin < 0)
1003  {
1004  zmin = z;
1005  indice = k;
1006  }
1007  }
1008  }
1009  if (indice >= 0)
1010  {
1011  if (simList[indice]->colorI == GRAY_SCALED)
1012  {
1013  unsigned char Ipixelplan = 255;
1014  simList[indice]->getPixel(ip,Ipixelplan);
1015  vpRGBa pixelcolor;
1016  pixelcolor.R = Ipixelplan;
1017  pixelcolor.G = Ipixelplan;
1018  pixelcolor.B = Ipixelplan;
1019  *(bitmap+i*width+j) = pixelcolor;
1020  }
1021  else if (simList[indice]->colorI == COLORED)
1022  {
1023  vpRGBa Ipixelplan(255,255,255);
1024  simList[indice]->getPixel(ip,Ipixelplan);
1025  //unsigned char pixelgrey = 0.2126 * Ipixelplan.R + 0.7152 * Ipixelplan.G + 0.0722 * Ipixelplan.B;
1026  *(bitmap+i*width+j)=Ipixelplan;
1027  }
1028  }
1029  }
1030  }
1031 
1032  delete[] simList;
1033 }
1034 
1040 void
1042 {
1043  cMt = cMt_;
1044  vpRotationMatrix R;
1045  cMt.extract(R);
1046  needClipping = false;
1047 
1048  normal_Cam = R * normal_obj;
1049 
1050  visible_result = vpColVector::dotProd(normal_Cam,focal);
1051 
1052  for(unsigned int i = 0; i < 4; i++)
1053  pt[i].track(cMt);
1054 
1055  vpColVector e1(3) ;
1056  vpColVector e2(3) ;
1057  vpColVector facenormal(3) ;
1058 
1059  e1[0] = pt[1].get_X() - pt[0].get_X() ;
1060  e1[1] = pt[1].get_Y() - pt[0].get_Y() ;
1061  e1[2] = pt[1].get_Z() - pt[0].get_Z() ;
1062 
1063  e2[0] = pt[2].get_X() - pt[1].get_X() ;
1064  e2[1] = pt[2].get_Y() - pt[1].get_Y() ;
1065  e2[2] = pt[2].get_Z() - pt[1].get_Z() ;
1066 
1067  facenormal = vpColVector::crossProd(e1,e2) ;
1068 
1069  double angle = pt[0].get_X()*facenormal[0] + pt[0].get_Y()*facenormal[1] + pt[0].get_Z()*facenormal[2] ;
1070 
1071  if (angle > 0){
1072  visible=true;
1073  }
1074  else {
1075  visible=false;
1076  }
1077 
1078  if(visible)
1079  {
1080  for(unsigned int i = 0; i < 4; i++)
1081  {
1082  project(X[i],cMt,X2[i]);
1083  pt[i].track(cMt);
1084  if(pt[i].get_Z() < 0)
1085  needClipping = true;
1086  }
1087 
1088  vbase_u = X2[1]-X2[0];
1089  vbase_v = X2[3]-X2[0];
1090 
1091  distance = vpColVector::dotProd(normal_Cam,X2[1]);
1092 
1093 
1094  if(distance < 0)
1095  {
1096  visible = false;
1097  return;
1098  }
1099 
1100  for(unsigned int i = 0; i < 3; i++)
1101  {
1102  normal_Cam_optim[i] = normal_Cam[i];
1103  X0_2_optim[i] = X2[0][i];
1104  vbase_u_optim[i] = vbase_u[i];
1105  vbase_v_optim[i] = vbase_v[i];
1106  }
1107 
1108  std::vector<vpPoint> *ptPtr = &pt;
1109  if(needClipping){
1111  ptPtr = &ptClipped;
1112  }
1113 
1114  listTriangle.clear();
1115  for(unsigned int i = 1 ; i < (*ptPtr).size()-1 ; i++){
1116  vpImagePoint ip1, ip2, ip3;
1117  ip1.set_j((*ptPtr)[0].get_x());
1118  ip1.set_i((*ptPtr)[0].get_y());
1119 
1120  ip2.set_j((*ptPtr)[i].get_x());
1121  ip2.set_i((*ptPtr)[i].get_y());
1122 
1123  ip3.set_j((*ptPtr)[i+1].get_x());
1124  ip3.set_i((*ptPtr)[i+1].get_y());
1125 
1126  vpTriangle tri(ip1,ip2,ip3);
1127  listTriangle.push_back(tri);
1128  }
1129  }
1130 }
1131 
1132 void
1133 vpImageSimulator::initPlan(vpColVector* X_)
1134 {
1135  for (unsigned int i = 0; i < 4; i++)
1136  {
1137  X[i]=X_[i];
1138  pt[i].setWorldCoordinates(X_[i][0],X_[i][1],X_[i][2]);
1139  }
1140 
1141  normal_obj=vpColVector::crossProd(X[1]-X[0],X[3]-X[0]);
1142  normal_obj=normal_obj/normal_obj.euclideanNorm();
1143 
1144  euclideanNorm_u=(X[1]-X[0]).euclideanNorm();
1145  euclideanNorm_v=(X[3]-X[0]).euclideanNorm();
1146 }
1147 
1161 void
1163 {
1164  Ig = I;
1166  initPlan(X_);
1167 }
1168 
1182 void
1184 {
1185  Ic = I;
1187  initPlan(X_);
1188 }
1189 
1190 #ifdef VISP_HAVE_MODULE_IO
1191 
1204 void
1205 vpImageSimulator::init(const char* file_image,vpColVector* X_)
1206 {
1207  vpImageIo::read(Ig,file_image);
1208  vpImageIo::read(Ic,file_image);
1209  initPlan(X_);
1210 }
1211 #endif
1212 
1227 void
1228 vpImageSimulator::init(const vpImage<unsigned char> &I, const std::vector<vpPoint>& X_)
1229 {
1230  if(X_.size() != 4){
1231  throw vpException(vpException::dimensionError, "the vector must contains 4 points to initialise the simulator");
1232  }
1233  vpColVector Xvec[4];
1234  for(unsigned int i=0; i<4; ++i){
1235  Xvec[i].resize(3);
1236  Xvec[i][0] = X_[i].get_oX();
1237  Xvec[i][1] = X_[i].get_oY();
1238  Xvec[i][2] = X_[i].get_oZ();
1239  }
1240 
1241  Ig = I;
1243  initPlan(Xvec);
1244 }
1259 void
1260 vpImageSimulator::init(const vpImage<vpRGBa> &I, const std::vector<vpPoint>& X_)
1261 {
1262  if(X_.size() != 4){
1263  throw vpException(vpException::dimensionError, "the vector must contains 4 points to initialise the simulator");
1264  }
1265  vpColVector Xvec[4];
1266  for(unsigned int i=0; i<4; ++i){
1267  Xvec[i].resize(3);
1268  Xvec[i][0] = X_[i].get_oX();
1269  Xvec[i][1] = X_[i].get_oY();
1270  Xvec[i][2] = X_[i].get_oZ();
1271  }
1272 
1273  Ic = I;
1275  initPlan(Xvec);
1276 }
1277 
1278 #ifdef VISP_HAVE_MODULE_IO
1279 
1293 void
1294 vpImageSimulator::init(const char* file_image, const std::vector<vpPoint>& X_)
1295 {
1296  if(X_.size() != 4){
1297  throw vpException(vpException::dimensionError, "the vector must contains 4 points to initialise the simulator");
1298  }
1299  vpColVector Xvec[4];
1300  for(unsigned int i=0; i<4; ++i){
1301  Xvec[i].resize(3);
1302  Xvec[i][0] = X_[i].get_oX();
1303  Xvec[i][1] = X_[i].get_oY();
1304  Xvec[i][2] = X_[i].get_oZ();
1305  }
1306 
1307  vpImageIo::read(Ig,file_image);
1308  vpImageIo::read(Ic,file_image);
1309  initPlan(Xvec);
1310 }
1311 #endif
1312 
1313 bool
1314 vpImageSimulator::getPixel(const vpImagePoint &iP, unsigned char &Ipixelplan)
1315 {
1316 // std::cout << "In get Pixel" << std::endl;
1317  //test si pixel dans zone projetee
1318  bool inside = false;
1319  for(unsigned int i = 0 ; i < listTriangle.size() ; i++)
1320  if(listTriangle[i].inTriangle(iP)){
1321  inside = true;
1322  break;
1323  }
1324  if(!inside) return false;
1325 
1326 // if(!T1.inTriangle(iP) && !T2.inTriangle(iP)){
1328 // return false;}
1329 
1330  //methoed algebrique
1331  double z;
1332 
1333  //calcul de la profondeur de l'intersection
1334  z = distance/(normal_Cam_optim[0]*iP.get_u()+normal_Cam_optim[1]*iP.get_v()+normal_Cam_optim[2]);
1335  //calcul coordonnees 3D intersection
1336  Xinter_optim[0]=iP.get_u()*z;
1337  Xinter_optim[1]=iP.get_v()*z;
1338  Xinter_optim[2]=z;
1339 
1340  //recuperation des coordonnes de l'intersection dans le plan objet
1341  //repere plan object :
1342  // centre = X0_2_optim[i] (premier point definissant le plan)
1343  // base = u:(X[1]-X[0]) et v:(X[3]-X[0])
1344  //ici j'ai considere que le plan est un rectangle => coordonnees sont simplement obtenu par un produit scalaire
1345  double u = 0, v = 0;
1346  double diff = 0;
1347  for(unsigned int i = 0; i < 3; i++)
1348  {
1349  diff = (Xinter_optim[i]-X0_2_optim[i]);
1350  u += diff*vbase_u_optim[i];
1351  v += diff*vbase_v_optim[i];
1352  }
1353  u = u/(euclideanNorm_u*euclideanNorm_u);
1354  v = v/(euclideanNorm_v*euclideanNorm_v);
1355 
1356  if( u > 0 && v > 0 && u < 1. && v < 1.)
1357  {
1358  double i2,j2;
1359  i2=v*(Ig.getHeight()-1);
1360  j2=u*(Ig.getWidth()-1);
1361  if (interp == BILINEAR_INTERPOLATION)
1362  Ipixelplan = Ig.getValue(i2,j2);
1363  else if (interp == SIMPLE)
1364  Ipixelplan = Ig[(unsigned int)i2][(unsigned int)j2];
1365  return true;
1366  }
1367  else
1368  return false;
1369 }
1370 
1371 bool
1372 vpImageSimulator::getPixel(vpImage<unsigned char> &Isrc,
1373  const vpImagePoint &iP, unsigned char &Ipixelplan)
1374 {
1375  //test si pixel dans zone projetee
1376  bool inside = false;
1377  for(unsigned int i = 0 ; i < listTriangle.size() ; i++)
1378  if(listTriangle[i].inTriangle(iP)){
1379  inside = true;
1380  break;
1381  }
1382  if(!inside) return false;
1383 
1384 // if(!T1.inTriangle(iP) && !T2.inTriangle(iP))
1385 // return false;
1386 
1387  //methoed algebrique
1388  double z;
1389 
1390  //calcul de la profondeur de l'intersection
1391  z = distance/(normal_Cam_optim[0]*iP.get_u()+normal_Cam_optim[1]*iP.get_v()+normal_Cam_optim[2]);
1392  //calcul coordonnees 3D intersection
1393  Xinter_optim[0]=iP.get_u()*z;
1394  Xinter_optim[1]=iP.get_v()*z;
1395  Xinter_optim[2]=z;
1396 
1397  //recuperation des coordonnes de l'intersection dans le plan objet
1398  //repere plan object :
1399  // centre = X0_2_optim[i] (premier point definissant le plan)
1400  // base = u:(X[1]-X[0]) et v:(X[3]-X[0])
1401  //ici j'ai considere que le plan est un rectangle => coordonnees sont simplement obtenu par un produit scalaire
1402  double u = 0, v = 0;
1403  double diff = 0;
1404  for(unsigned int i = 0; i < 3; i++)
1405  {
1406  diff = (Xinter_optim[i]-X0_2_optim[i]);
1407  u += diff*vbase_u_optim[i];
1408  v += diff*vbase_v_optim[i];
1409  }
1410  u = u/(euclideanNorm_u*euclideanNorm_u);
1411  v = v/(euclideanNorm_v*euclideanNorm_v);
1412 
1413  if( u > 0 && v > 0 && u < 1. && v < 1.)
1414  {
1415  double i2,j2;
1416  i2=v*(Isrc.getHeight()-1);
1417  j2=u*(Isrc.getWidth()-1);
1418  if (interp == BILINEAR_INTERPOLATION)
1419  Ipixelplan = Isrc.getValue(i2,j2);
1420  else if (interp == SIMPLE)
1421  Ipixelplan = Isrc[(unsigned int)i2][(unsigned int)j2];
1422  return true;
1423  }
1424  else
1425  return false;
1426 }
1427 
1428 
1429 bool
1430 vpImageSimulator::getPixel(const vpImagePoint &iP, vpRGBa &Ipixelplan)
1431 {
1432  //test si pixel dans zone projetee
1433  bool inside = false;
1434  for(unsigned int i = 0 ; i < listTriangle.size() ; i++)
1435  if(listTriangle[i].inTriangle(iP)){
1436  inside = true;
1437  break;
1438  }
1439  if(!inside) return false;
1440 // if(!T1.inTriangle(iP) && !T2.inTriangle(iP))
1441 // return false;
1442 
1443  //methoed algebrique
1444  double z;
1445 
1446  //calcul de la profondeur de l'intersection
1447  z = distance/(normal_Cam_optim[0]*iP.get_u()+normal_Cam_optim[1]*iP.get_v()+normal_Cam_optim[2]);
1448  //calcul coordonnees 3D intersection
1449  Xinter_optim[0]=iP.get_u()*z;
1450  Xinter_optim[1]=iP.get_v()*z;
1451  Xinter_optim[2]=z;
1452 
1453  //recuperation des coordonnes de l'intersection dans le plan objet
1454  //repere plan object :
1455  // centre = X0_2_optim[i] (premier point definissant le plan)
1456  // base = u:(X[1]-X[0]) et v:(X[3]-X[0])
1457  //ici j'ai considere que le plan est un rectangle => coordonnees sont simplement obtenu par un produit scalaire
1458  double u = 0, v = 0;
1459  double diff = 0;
1460  for(unsigned int i = 0; i < 3; i++)
1461  {
1462  diff = (Xinter_optim[i]-X0_2_optim[i]);
1463  u += diff*vbase_u_optim[i];
1464  v += diff*vbase_v_optim[i];
1465  }
1466  u = u/(euclideanNorm_u*euclideanNorm_u);
1467  v = v/(euclideanNorm_v*euclideanNorm_v);
1468 
1469  if( u > 0 && v > 0 && u < 1. && v < 1.)
1470  {
1471  double i2,j2;
1472  i2=v*(Ic.getHeight()-1);
1473  j2=u*(Ic.getWidth()-1);
1474  if (interp == BILINEAR_INTERPOLATION)
1475  Ipixelplan = Ic.getValue(i2,j2);
1476  else if (interp == SIMPLE)
1477  Ipixelplan = Ic[(unsigned int)i2][(unsigned int)j2];
1478  return true;
1479  }
1480  else
1481  return false;
1482 }
1483 
1484 bool
1485 vpImageSimulator::getPixel(vpImage<vpRGBa> &Isrc, const vpImagePoint &iP,
1486  vpRGBa &Ipixelplan)
1487 {
1488  //test si pixel dans zone projetee
1489 // if(!T1.inTriangle(iP) && !T2.inTriangle(iP))
1490 // return false;
1491  bool inside = false;
1492  for(unsigned int i = 0 ; i < listTriangle.size() ; i++)
1493  if(listTriangle[i].inTriangle(iP)){
1494  inside = true;
1495  break;
1496  }
1497  if(!inside) return false;
1498 
1499  //methoed algebrique
1500  double z;
1501 
1502  //calcul de la profondeur de l'intersection
1503  z = distance/(normal_Cam_optim[0]*iP.get_u()+normal_Cam_optim[1]*iP.get_v()+normal_Cam_optim[2]);
1504  //calcul coordonnees 3D intersection
1505  Xinter_optim[0]=iP.get_u()*z;
1506  Xinter_optim[1]=iP.get_v()*z;
1507  Xinter_optim[2]=z;
1508 
1509  //recuperation des coordonnes de l'intersection dans le plan objet
1510  //repere plan object :
1511  // centre = X0_2_optim[i] (premier point definissant le plan)
1512  // base = u:(X[1]-X[0]) et v:(X[3]-X[0])
1513  //ici j'ai considere que le plan est un rectangle => coordonnees sont simplement obtenu par un produit scalaire
1514  double u = 0, v = 0;
1515  double diff = 0;
1516  for(unsigned int i = 0; i < 3; i++)
1517  {
1518  diff = (Xinter_optim[i]-X0_2_optim[i]);
1519  u += diff*vbase_u_optim[i];
1520  v += diff*vbase_v_optim[i];
1521  }
1522  u = u/(euclideanNorm_u*euclideanNorm_u);
1523  v = v/(euclideanNorm_v*euclideanNorm_v);
1524 
1525  if( u > 0 && v > 0 && u < 1. && v < 1.)
1526  {
1527  double i2,j2;
1528  i2=v*(Isrc.getHeight()-1);
1529  j2=u*(Isrc.getWidth()-1);
1530  if (interp == BILINEAR_INTERPOLATION)
1531  Ipixelplan = Isrc.getValue(i2,j2);
1532  else if (interp == SIMPLE)
1533  Ipixelplan = Isrc[(unsigned int)i2][(unsigned int)j2];
1534  return true;
1535  }
1536  else
1537  return false;
1538 }
1539 
1540 bool
1541 vpImageSimulator::getPixelDepth(const vpImagePoint &iP, double &Zpixelplan)
1542 {
1543  //test si pixel dans zone projetee
1544  bool inside = false;
1545  for(unsigned int i = 0 ; i < listTriangle.size() ; i++)
1546  if(listTriangle[i].inTriangle(iP)){
1547  inside = true;
1548  break;
1549  }
1550  if(!inside) return false;
1551 // if(!T1.inTriangle(iP) && !T2.inTriangle(iP))
1552 // return false;
1553 
1554  Zpixelplan = distance/(normal_Cam_optim[0]*iP.get_u()+normal_Cam_optim[1]*iP.get_v()+normal_Cam_optim[2]);
1555  return true;
1556 }
1557 
1558 bool
1559 vpImageSimulator::getPixelVisibility(const vpImagePoint &iP,
1560  double &Visipixelplan)
1561 {
1562  //test si pixel dans zone projetee
1563  bool inside = false;
1564  for(unsigned int i = 0 ; i < listTriangle.size() ; i++)
1565  if(listTriangle[i].inTriangle(iP)){
1566  inside = true;
1567  break;
1568  }
1569  if(!inside) return false;
1570 // if(!T1.inTriangle(iP) && !T2.inTriangle(iP))
1571 // return false;
1572 
1573  Visipixelplan = visible_result;
1574  return true;
1575 }
1576 
1577 void
1578 vpImageSimulator::project(const vpColVector &_vin,
1579  const vpHomogeneousMatrix &_cMt, vpColVector &_vout)
1580 {
1581  vpColVector XH(4);
1582  getHomogCoord(_vin,XH);
1583  getCoordFromHomog(_cMt*XH,_vout);
1584 }
1585 
1586 void
1587 vpImageSimulator::getHomogCoord(const vpColVector &_v, vpColVector &_vH)
1588 {
1589  for(unsigned int i=0;i<3;i++)
1590  _vH[i]=_v[i];
1591  _vH[3]=1.;
1592 }
1593 
1594 void
1595 vpImageSimulator::getCoordFromHomog(const vpColVector &_vH, vpColVector &_v)
1596 {
1597  for(unsigned int i=0;i<3;i++)
1598  _v[i]=_vH[i]/_vH[3];
1599 }
1600 
1601 
1602 void
1603 vpImageSimulator::getRoi(const unsigned int &Iwidth,
1604  const unsigned int &Iheight,
1605  const vpCameraParameters &cam,
1606  const std::vector<vpPoint> &point,
1607  vpRect &rectangle)
1608 {
1609  double top = Iheight+1;
1610  double bottom = -1;
1611  double right = -1;
1612  double left= Iwidth+1;
1613 
1614  for( unsigned int i = 0; i < point.size(); i++)
1615  {
1616  double u=0,v=0;
1617  vpMeterPixelConversion::convertPoint(cam,point[i].get_x(),point[i].get_y(),u,v);
1618  if (v < top) top = v;
1619  if (v > bottom) bottom = v;
1620  if (u < left) left = u;
1621  if (u > right) right = u;
1622  }
1623  if (top < 0) top = 0;
1624  if(top >= Iheight) top = Iheight-1;
1625  if (bottom < 0) bottom = 0;
1626  if(bottom >= Iheight) bottom = Iheight-1;
1627  if(left < 0) left = 0;
1628  if(left >= Iwidth) left = Iwidth-1;
1629  if(right < 0) right = 0;
1630  if(right >= Iwidth) right = Iwidth-1;
1631 
1632  rectangle.setTop(top);
1633  rectangle.setBottom(bottom);
1634  rectangle.setLeft(left);
1635  rectangle.setRight(right);
1636 }
1637 
1638 std::vector<vpColVector>
1640 {
1641  std::vector<vpColVector> X_;
1642  for (int i=0; i<4; i++)
1643  X_.push_back(X[i]);
1644  return X_;
1645 }
1646 
1647 VISP_EXPORT std::ostream& operator<< (std::ostream &os, const vpImageSimulator& /*ip*/)
1648 {
1649  os << "";
1650  return os;
1651 }
Implementation of a matrix and operations on matrices.
Definition: vpMatrix.h:92
double getTop() const
Definition: vpRect.h:176
double get_v() const
Definition: vpImagePoint.h:259
void init(const vpImage< unsigned char > &I, vpColVector *X)
unsigned int getWidth() const
Definition: vpImage.h:161
static void convert(const vpImage< unsigned char > &src, vpImage< vpRGBa > &dest)
Implementation of an homogeneous matrix and operations on such kind of matrices.
unsigned char B
Blue component.
Definition: vpRGBa.h:144
double euclideanNorm() const
Type * bitmap
points toward the bitmap
Definition: vpImage.h:116
void getImage(vpImage< unsigned char > &I, const vpCameraParameters &cam)
static void convertPoint(const vpCameraParameters &cam, const double &x, const double &y, double &u, double &v)
Point coordinates conversion from normalized coordinates in meter to pixel coordinates ...
Class to define colors available for display functionnalities.
Definition: vpColor.h:121
void setLeft(double pos)
Definition: vpRect.h:242
double get_u() const
Definition: vpImagePoint.h:248
Defines a 2D triangle.
Definition: vpTriangle.h:55
error that can be emited by ViSP classes.
Definition: vpException.h:73
Type getValue(double i, double j) const
Definition: vpImage.h:1148
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...
unsigned int getCols() const
Return the number of columns of the 2D array.
Definition: vpArray2D.h:154
unsigned char G
Green component.
Definition: vpRGBa.h:143
double getRight() const
Definition: vpRect.h:163
Class that defines a RGB 32 bits structure.
Definition: vpRGBa.h:64
Implementation of a rotation matrix and operations on such kind of matrices.
double getBottom() const
Definition: vpRect.h:99
void set_i(const double ii)
Definition: vpImagePoint.h:154
void setTop(double pos)
Definition: vpRect.h:276
void setCameraPosition(const vpHomogeneousMatrix &cMt)
vpImageSimulator & operator=(const vpImageSimulator &sim)
Generic class defining intrinsic camera parameters.
Class which enables to project an image in the 3D space and get the view of a virtual camera...
void extract(vpRotationMatrix &R) const
friend std::ostream & operator<<(std::ostream &s, const vpArray2D< Type > &A)
Definition: vpArray2D.h:267
unsigned int getRows() const
Return the number of rows of the 2D array.
Definition: vpArray2D.h:152
vpImageSimulator(const vpColorPlan &col=COLORED)
void set_j(const double jj)
Definition: vpImagePoint.h:165
Implementation of column vector and the associated operations.
Definition: vpColVector.h:72
static double dotProd(const vpColVector &a, const vpColVector &b)
void setRight(double pos)
Definition: vpRect.h:267
std::vector< vpColVector > get3DcornersTextureRectangle()
unsigned char R
Red component.
Definition: vpRGBa.h:142
error that can be emited by the vpMatrix class and its derivates
unsigned int getHeight() const
Definition: vpImage.h:152
Defines a rectangle in the plane.
Definition: vpRect.h:81
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)
Class that defines a 2D point in an image. This class is useful for image processing and stores only ...
Definition: vpImagePoint.h:88
static vpColVector crossProd(const vpColVector &a, const vpColVector &b)
static void read(vpImage< unsigned char > &I, const char *filename)
Definition: vpImageIo.cpp:274
double getLeft() const
Definition: vpRect.h:157
void setBottom(double pos)
Definition: vpRect.h:213
void set_ij(const double ii, const double jj)
Definition: vpImagePoint.h:176
void resize(const unsigned int i, const bool flagNullify=true)
Definition: vpColVector.h:217