Visual Servoing Platform  version 3.0.1
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
vpImageSimulator.cpp
1 /****************************************************************************
2  *
3  * This file is part of the ViSP software.
4  * Copyright (C) 2005 - 2017 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  if (setBackgroundTexture)
201  // The Ig has been set to a previously defined background texture
202  I = Ig;
203  else
204  {
205  if (cleanPrevImage)
206  {
207  unsigned char col = (unsigned char) (0.2126 * bgColor.R
208  + 0.7152 * bgColor.G + 0.0722 * bgColor.B);
209  for (unsigned int i = 0; i < I.getHeight(); i++)
210  {
211  for (unsigned int j = 0; j < I.getWidth(); j++)
212  {
213  I[i][j] = col;
214  }
215  }
216  }
217  }
218 
219  if(visible)
220  {
221  if(!needClipping)
222  getRoi(I.getWidth(),I.getHeight(),cam,pt,rect);
223  else
224  getRoi(I.getWidth(),I.getHeight(),cam,ptClipped,rect);
225 
226  double top = rect.getTop();
227  double bottom = rect.getBottom();
228  double left = rect.getLeft();
229  double right= rect.getRight();
230 
231  unsigned char *bitmap = I.bitmap;
232  unsigned int width = I.getWidth();
233  vpImagePoint ip;
234  int nb_point_dessine = 0;
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  if (cleanPrevImage)
282  {
283  unsigned char col = (unsigned char)(0.2126 * bgColor.R + 0.7152 * bgColor.G + 0.0722 * bgColor.B);
284  for (unsigned int i = 0; i < I.getHeight(); i++)
285  {
286  for (unsigned int j = 0; j < I.getWidth(); j++)
287  {
288  I[i][j] = col;
289  }
290  }
291  }
292  if(visible)
293  {
294  if(!needClipping)
295  getRoi(I.getWidth(),I.getHeight(),cam,pt,rect);
296  else
297  getRoi(I.getWidth(),I.getHeight(),cam,ptClipped,rect);
298 
299  double top = rect.getTop();
300  double bottom = rect.getBottom();
301  double left = rect.getLeft();
302  double right= rect.getRight();
303 
304  unsigned char *bitmap = I.bitmap;
305  unsigned int width = I.getWidth();
306  vpImagePoint ip;
307  int nb_point_dessine = 0;
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  if (cleanPrevImage)
345  {
346  unsigned char col = (unsigned char)(0.2126 * bgColor.R + 0.7152 * bgColor.G + 0.0722 * bgColor.B);
347  for (unsigned int i = 0; i < I.getHeight(); i++)
348  {
349  for (unsigned int j = 0; j < I.getWidth(); j++)
350  {
351  I[i][j] = col;
352  }
353  }
354  }
355  if(visible)
356  {
357  if(!needClipping)
358  getRoi(I.getWidth(),I.getHeight(),cam,pt,rect);
359  else
360  getRoi(I.getWidth(),I.getHeight(),cam,ptClipped,rect);
361 
362  double top = rect.getTop();
363  double bottom = rect.getBottom();
364  double left = rect.getLeft();
365  double right= rect.getRight();
366 
367  unsigned char *bitmap = I.bitmap;
368  unsigned int width = I.getWidth();
369  vpImagePoint ip;
370  int nb_point_dessine = 0;
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  if (cleanPrevImage)
422  {
423  for (unsigned int i = 0; i < I.getHeight(); i++)
424  {
425  for (unsigned int j = 0; j < I.getWidth(); j++)
426  {
427  I[i][j] = bgColor;
428  }
429  }
430  }
431 
432  if(visible)
433  {
434  if(!needClipping)
435  getRoi(I.getWidth(),I.getHeight(),cam,pt,rect);
436  else
437  getRoi(I.getWidth(),I.getHeight(),cam,ptClipped,rect);
438 
439  double top = rect.getTop();
440  double bottom = rect.getBottom();
441  double left = rect.getLeft();
442  double right= rect.getRight();
443 
444  vpRGBa *bitmap = I.bitmap;
445  unsigned int width = I.getWidth();
446  vpImagePoint ip;
447  int nb_point_dessine = 0;
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  if (cleanPrevImage)
497  {
498  for (unsigned int i = 0; i < I.getHeight(); i++)
499  {
500  for (unsigned int j = 0; j < I.getWidth(); j++)
501  {
502  I[i][j] = bgColor;
503  }
504  }
505  }
506 
507  if(visible)
508  {
509  if(!needClipping)
510  getRoi(I.getWidth(),I.getHeight(),cam,pt,rect);
511  else
512  getRoi(I.getWidth(),I.getHeight(),cam,ptClipped,rect);
513 
514  double top = rect.getTop();
515  double bottom = rect.getBottom();
516  double left = rect.getLeft();
517  double right= rect.getRight();
518 
519  vpRGBa *bitmap = I.bitmap;
520  unsigned int width = I.getWidth();
521  vpImagePoint ip;
522  int nb_point_dessine = 0;
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  if (cleanPrevImage)
560  {
561  for (unsigned int i = 0; i < I.getHeight(); i++)
562  {
563  for (unsigned int j = 0; j < I.getWidth(); j++)
564  {
565  I[i][j] = bgColor;
566  }
567  }
568  }
569  if(visible)
570  {
571  if(!needClipping)
572  getRoi(I.getWidth(),I.getHeight(),cam,pt,rect);
573  else
574  getRoi(I.getWidth(),I.getHeight(),cam,ptClipped,rect);
575 
576  double top = rect.getTop();
577  double bottom = rect.getBottom();
578  double left = rect.getLeft();
579  double right= rect.getRight();
580 
581  vpRGBa *bitmap = I.bitmap;
582  unsigned int width = I.getWidth();
583  vpImagePoint ip;
584  int nb_point_dessine = 0;
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  for(unsigned int i = 0; i < 3; i++)
1347  {
1348  double diff = (Xinter_optim[i]-X0_2_optim[i]);
1349  u += diff*vbase_u_optim[i];
1350  v += diff*vbase_v_optim[i];
1351  }
1352  u = u/(euclideanNorm_u*euclideanNorm_u);
1353  v = v/(euclideanNorm_v*euclideanNorm_v);
1354 
1355  if( u > 0 && v > 0 && u < 1. && v < 1.)
1356  {
1357  double i2,j2;
1358  i2=v*(Ig.getHeight()-1);
1359  j2=u*(Ig.getWidth()-1);
1360  if (interp == BILINEAR_INTERPOLATION)
1361  Ipixelplan = Ig.getValue(i2,j2);
1362  else if (interp == SIMPLE)
1363  Ipixelplan = Ig[(unsigned int)i2][(unsigned int)j2];
1364  return true;
1365  }
1366  else
1367  return false;
1368 }
1369 
1370 bool
1371 vpImageSimulator::getPixel(vpImage<unsigned char> &Isrc,
1372  const vpImagePoint &iP, unsigned char &Ipixelplan)
1373 {
1374  //test si pixel dans zone projetee
1375  bool inside = false;
1376  for(unsigned int i = 0 ; i < listTriangle.size() ; i++)
1377  if(listTriangle[i].inTriangle(iP)){
1378  inside = true;
1379  break;
1380  }
1381  if(!inside) return false;
1382 
1383 // if(!T1.inTriangle(iP) && !T2.inTriangle(iP))
1384 // return false;
1385 
1386  //methoed algebrique
1387  double z;
1388 
1389  //calcul de la profondeur de l'intersection
1390  z = distance/(normal_Cam_optim[0]*iP.get_u()+normal_Cam_optim[1]*iP.get_v()+normal_Cam_optim[2]);
1391  //calcul coordonnees 3D intersection
1392  Xinter_optim[0]=iP.get_u()*z;
1393  Xinter_optim[1]=iP.get_v()*z;
1394  Xinter_optim[2]=z;
1395 
1396  //recuperation des coordonnes de l'intersection dans le plan objet
1397  //repere plan object :
1398  // centre = X0_2_optim[i] (premier point definissant le plan)
1399  // base = u:(X[1]-X[0]) et v:(X[3]-X[0])
1400  //ici j'ai considere que le plan est un rectangle => coordonnees sont simplement obtenu par un produit scalaire
1401  double u = 0, v = 0;
1402  for(unsigned int i = 0; i < 3; i++)
1403  {
1404  double diff = (Xinter_optim[i]-X0_2_optim[i]);
1405  u += diff*vbase_u_optim[i];
1406  v += diff*vbase_v_optim[i];
1407  }
1408  u = u/(euclideanNorm_u*euclideanNorm_u);
1409  v = v/(euclideanNorm_v*euclideanNorm_v);
1410 
1411  if( u > 0 && v > 0 && u < 1. && v < 1.)
1412  {
1413  double i2,j2;
1414  i2=v*(Isrc.getHeight()-1);
1415  j2=u*(Isrc.getWidth()-1);
1416  if (interp == BILINEAR_INTERPOLATION)
1417  Ipixelplan = Isrc.getValue(i2,j2);
1418  else if (interp == SIMPLE)
1419  Ipixelplan = Isrc[(unsigned int)i2][(unsigned int)j2];
1420  return true;
1421  }
1422  else
1423  return false;
1424 }
1425 
1426 
1427 bool
1428 vpImageSimulator::getPixel(const vpImagePoint &iP, vpRGBa &Ipixelplan)
1429 {
1430  //test si pixel dans zone projetee
1431  bool inside = false;
1432  for(unsigned int i = 0 ; i < listTriangle.size() ; i++)
1433  if(listTriangle[i].inTriangle(iP)){
1434  inside = true;
1435  break;
1436  }
1437  if(!inside) return false;
1438 // if(!T1.inTriangle(iP) && !T2.inTriangle(iP))
1439 // return false;
1440 
1441  //methoed algebrique
1442  double z;
1443 
1444  //calcul de la profondeur de l'intersection
1445  z = distance/(normal_Cam_optim[0]*iP.get_u()+normal_Cam_optim[1]*iP.get_v()+normal_Cam_optim[2]);
1446  //calcul coordonnees 3D intersection
1447  Xinter_optim[0]=iP.get_u()*z;
1448  Xinter_optim[1]=iP.get_v()*z;
1449  Xinter_optim[2]=z;
1450 
1451  //recuperation des coordonnes de l'intersection dans le plan objet
1452  //repere plan object :
1453  // centre = X0_2_optim[i] (premier point definissant le plan)
1454  // base = u:(X[1]-X[0]) et v:(X[3]-X[0])
1455  //ici j'ai considere que le plan est un rectangle => coordonnees sont simplement obtenu par un produit scalaire
1456  double u = 0, v = 0;
1457  for(unsigned int i = 0; i < 3; i++)
1458  {
1459  double diff = (Xinter_optim[i]-X0_2_optim[i]);
1460  u += diff*vbase_u_optim[i];
1461  v += diff*vbase_v_optim[i];
1462  }
1463  u = u/(euclideanNorm_u*euclideanNorm_u);
1464  v = v/(euclideanNorm_v*euclideanNorm_v);
1465 
1466  if( u > 0 && v > 0 && u < 1. && v < 1.)
1467  {
1468  double i2,j2;
1469  i2=v*(Ic.getHeight()-1);
1470  j2=u*(Ic.getWidth()-1);
1471  if (interp == BILINEAR_INTERPOLATION)
1472  Ipixelplan = Ic.getValue(i2,j2);
1473  else if (interp == SIMPLE)
1474  Ipixelplan = Ic[(unsigned int)i2][(unsigned int)j2];
1475  return true;
1476  }
1477  else
1478  return false;
1479 }
1480 
1481 bool
1482 vpImageSimulator::getPixel(vpImage<vpRGBa> &Isrc, const vpImagePoint &iP,
1483  vpRGBa &Ipixelplan)
1484 {
1485  //test si pixel dans zone projetee
1486 // if(!T1.inTriangle(iP) && !T2.inTriangle(iP))
1487 // return false;
1488  bool inside = false;
1489  for(unsigned int i = 0 ; i < listTriangle.size() ; i++)
1490  if(listTriangle[i].inTriangle(iP)){
1491  inside = true;
1492  break;
1493  }
1494  if(!inside) return false;
1495 
1496  //methoed algebrique
1497  double z;
1498 
1499  //calcul de la profondeur de l'intersection
1500  z = distance/(normal_Cam_optim[0]*iP.get_u()+normal_Cam_optim[1]*iP.get_v()+normal_Cam_optim[2]);
1501  //calcul coordonnees 3D intersection
1502  Xinter_optim[0]=iP.get_u()*z;
1503  Xinter_optim[1]=iP.get_v()*z;
1504  Xinter_optim[2]=z;
1505 
1506  //recuperation des coordonnes de l'intersection dans le plan objet
1507  //repere plan object :
1508  // centre = X0_2_optim[i] (premier point definissant le plan)
1509  // base = u:(X[1]-X[0]) et v:(X[3]-X[0])
1510  //ici j'ai considere que le plan est un rectangle => coordonnees sont simplement obtenu par un produit scalaire
1511  double u = 0, v = 0;
1512  for(unsigned int i = 0; i < 3; i++)
1513  {
1514  double diff = (Xinter_optim[i]-X0_2_optim[i]);
1515  u += diff*vbase_u_optim[i];
1516  v += diff*vbase_v_optim[i];
1517  }
1518  u = u/(euclideanNorm_u*euclideanNorm_u);
1519  v = v/(euclideanNorm_v*euclideanNorm_v);
1520 
1521  if( u > 0 && v > 0 && u < 1. && v < 1.)
1522  {
1523  double i2,j2;
1524  i2=v*(Isrc.getHeight()-1);
1525  j2=u*(Isrc.getWidth()-1);
1526  if (interp == BILINEAR_INTERPOLATION)
1527  Ipixelplan = Isrc.getValue(i2,j2);
1528  else if (interp == SIMPLE)
1529  Ipixelplan = Isrc[(unsigned int)i2][(unsigned int)j2];
1530  return true;
1531  }
1532  else
1533  return false;
1534 }
1535 
1536 bool
1537 vpImageSimulator::getPixelDepth(const vpImagePoint &iP, double &Zpixelplan)
1538 {
1539  //test si pixel dans zone projetee
1540  bool inside = false;
1541  for(unsigned int i = 0 ; i < listTriangle.size() ; i++)
1542  if(listTriangle[i].inTriangle(iP)){
1543  inside = true;
1544  break;
1545  }
1546  if(!inside) return false;
1547 // if(!T1.inTriangle(iP) && !T2.inTriangle(iP))
1548 // return false;
1549 
1550  Zpixelplan = distance/(normal_Cam_optim[0]*iP.get_u()+normal_Cam_optim[1]*iP.get_v()+normal_Cam_optim[2]);
1551  return true;
1552 }
1553 
1554 bool
1555 vpImageSimulator::getPixelVisibility(const vpImagePoint &iP,
1556  double &Visipixelplan)
1557 {
1558  //test si pixel dans zone projetee
1559  bool inside = false;
1560  for(unsigned int i = 0 ; i < listTriangle.size() ; i++)
1561  if(listTriangle[i].inTriangle(iP)){
1562  inside = true;
1563  break;
1564  }
1565  if(!inside) return false;
1566 // if(!T1.inTriangle(iP) && !T2.inTriangle(iP))
1567 // return false;
1568 
1569  Visipixelplan = visible_result;
1570  return true;
1571 }
1572 
1573 void
1574 vpImageSimulator::project(const vpColVector &_vin,
1575  const vpHomogeneousMatrix &_cMt, vpColVector &_vout)
1576 {
1577  vpColVector XH(4);
1578  getHomogCoord(_vin,XH);
1579  getCoordFromHomog(_cMt*XH,_vout);
1580 }
1581 
1582 void
1583 vpImageSimulator::getHomogCoord(const vpColVector &_v, vpColVector &_vH)
1584 {
1585  for(unsigned int i=0;i<3;i++)
1586  _vH[i]=_v[i];
1587  _vH[3]=1.;
1588 }
1589 
1590 void
1591 vpImageSimulator::getCoordFromHomog(const vpColVector &_vH, vpColVector &_v)
1592 {
1593  for(unsigned int i=0;i<3;i++)
1594  _v[i]=_vH[i]/_vH[3];
1595 }
1596 
1597 
1598 void
1599 vpImageSimulator::getRoi(const unsigned int &Iwidth,
1600  const unsigned int &Iheight,
1601  const vpCameraParameters &cam,
1602  const std::vector<vpPoint> &point,
1603  vpRect &rectangle)
1604 {
1605  double top = Iheight+1;
1606  double bottom = -1;
1607  double right = -1;
1608  double left= Iwidth+1;
1609 
1610  for( unsigned int i = 0; i < point.size(); i++)
1611  {
1612  double u=0,v=0;
1613  vpMeterPixelConversion::convertPoint(cam,point[i].get_x(),point[i].get_y(),u,v);
1614  if (v < top) top = v;
1615  if (v > bottom) bottom = v;
1616  if (u < left) left = u;
1617  if (u > right) right = u;
1618  }
1619  if (top < 0) top = 0;
1620  if(top >= Iheight) top = Iheight-1;
1621  if (bottom < 0) bottom = 0;
1622  if(bottom >= Iheight) bottom = Iheight-1;
1623  if(left < 0) left = 0;
1624  if(left >= Iwidth) left = Iwidth-1;
1625  if(right < 0) right = 0;
1626  if(right >= Iwidth) right = Iwidth-1;
1627 
1628  rectangle.setTop(top);
1629  rectangle.setBottom(bottom);
1630  rectangle.setLeft(left);
1631  rectangle.setRight(right);
1632 }
1633 
1634 std::vector<vpColVector>
1636 {
1637  std::vector<vpColVector> X_;
1638  for (int i=0; i<4; i++)
1639  X_.push_back(X[i]);
1640  return X_;
1641 }
1642 
1643 VISP_EXPORT std::ostream& operator<< (std::ostream &os, const vpImageSimulator& /*ip*/)
1644 {
1645  os << "";
1646  return os;
1647 }
Implementation of a matrix and operations on matrices.
Definition: vpMatrix.h:97
double getTop() const
Definition: vpRect.h:178
double get_v() const
Definition: vpImagePoint.h:268
void init(const vpImage< unsigned char > &I, vpColVector *X)
unsigned int getWidth() const
Definition: vpImage.h:226
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:155
double euclideanNorm() const
Type * bitmap
points toward the bitmap
Definition: vpImage.h:134
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:257
double get_u() const
Definition: vpImagePoint.h:257
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:1477
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:154
double getRight() const
Definition: vpRect.h:165
Definition: vpRGBa.h:66
Implementation of a rotation matrix and operations on such kind of matrices.
double getBottom() const
Definition: vpRect.h:100
void set_i(const double ii)
Definition: vpImagePoint.h:163
void setTop(double pos)
Definition: vpRect.h:292
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:174
static void read(vpImage< unsigned char > &I, const std::string &filename)
Definition: vpImageIo.cpp:205
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:283
std::vector< vpColVector > get3DcornersTextureRectangle()
unsigned char R
Red component.
Definition: vpRGBa.h:153
error that can be emited by the vpMatrix class and its derivates
unsigned int getHeight() const
Definition: vpImage.h:175
Defines a rectangle in the plane.
Definition: vpRect.h:82
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)
double getLeft() const
Definition: vpRect.h:159
void setBottom(double pos)
Definition: vpRect.h:226
void set_ij(const double ii, const double jj)
Definition: vpImagePoint.h:185
void resize(const unsigned int i, const bool flagNullify=true)
Definition: vpColVector.h:225