当前位置: 首页>>代码示例>>C++>>正文


C++ vpImagePoint::get_u方法代码示例

本文整理汇总了C++中vpImagePoint::get_u方法的典型用法代码示例。如果您正苦于以下问题:C++ vpImagePoint::get_u方法的具体用法?C++ vpImagePoint::get_u怎么用?C++ vpImagePoint::get_u使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在vpImagePoint的用法示例。


在下文中一共展示了vpImagePoint::get_u方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: vpTRACE

/*!
  Display a dashed line from image point \e ip1 to image point \e ip2.

  \warning Dot lines are not yet implemented in OpenCV. We display a
  normal line instead.

  \param ip1,ip2 : Initial and final image points.
  \param color : Line color.
  \param thickness : Line thickness.
*/
void
vpDisplayOpenCV::displayDotLine(const vpImagePoint &ip1, 
				const vpImagePoint &ip2,
				const vpColor &color, 
				unsigned int thickness)
{

  if (displayHasBeenInitialized)
  {
    vpTRACE("Dot lines are not yet implemented");
    if (color.id < vpColor::id_unknown) {
      cvLine( background, 
	      cvPoint( vpMath::round( ip1.get_u() ), 
		       vpMath::round( ip1.get_v() ) ), 
	      cvPoint( vpMath::round( ip2.get_u() ),
		       vpMath::round( ip2.get_v() ) ), 
	      col[color.id], (int) thickness);
    }
    else {
      cvcolor = CV_RGB(color.R, color.G, color.B) ;
      cvLine( background, 
	      cvPoint( vpMath::round( ip1.get_u() ), 
		       vpMath::round( ip1.get_v() ) ), 
	      cvPoint( vpMath::round( ip2.get_u() ),
		       vpMath::round( ip2.get_v() ) ), 
	      cvcolor, (int) thickness);
    }
  }
  else
  {
    vpERROR_TRACE("OpenCV not initialized " ) ;
    throw(vpDisplayException(vpDisplayException::notInitializedError,
                             "OpenCV not initialized")) ;
  }
}
开发者ID:GVallicrosa,项目名称:Armed-turtlebot,代码行数:45,代码来源:vpDisplayOpenCV.cpp

示例2: displayLine

/*!
  Display a line from image point \e ip1 to image point \e ip2.
  \param ip1,ip2 : Initial and final image points.
  \param color : Line color.
  \param thickness : Line thickness.
*/
void vpDisplayGTK::displayLine ( const vpImagePoint &ip1, 
				 const vpImagePoint &ip2,
				 const vpColor &color, 
				 unsigned int thickness )
{
  if (displayHasBeenInitialized)
  {
    if ( thickness == 1 ) thickness = 0;

    if (color.id < vpColor::id_unknown)
      gdk_gc_set_foreground(gc, col[color.id]);
    else {
      gdkcolor.red   = 256 * color.R;
      gdkcolor.green = 256 * color.G;
      gdkcolor.blue  = 256 * color.B;
      gdk_colormap_alloc_color(colormap,&gdkcolor,FALSE,TRUE);
      gdk_gc_set_foreground(gc, &gdkcolor);     
    }

    gdk_gc_set_line_attributes(gc, (gint)thickness,
			       GDK_LINE_SOLID, GDK_CAP_BUTT,
			       GDK_JOIN_BEVEL) ;
    gdk_draw_line(background, gc,
		  vpMath::round( ip1.get_u() ),
		  vpMath::round( ip1.get_v() ),
		  vpMath::round( ip2.get_u() ),
		  vpMath::round( ip2.get_v() ) );
  }
  else
  {
    vpERROR_TRACE("GTK not initialized " ) ;
    throw(vpDisplayException(vpDisplayException::notInitializedError,
                             "GTK not initialized")) ;
  }
}
开发者ID:ricsp,项目名称:visp,代码行数:41,代码来源:vpDisplayGTK.cpp

示例3: displayCharString

/*!
  Display a string at the image point \e ip location.

  To select the font used to display the string, use setFont().

  \param ip : Upper left image point location of the string in the display.
  \param text : String to display in overlay.
  \param color : String color.

  \sa setFont()
*/
void vpDisplayOpenCV::displayCharString( const vpImagePoint &ip,
                                     const char *text, 
				     const vpColor &color )
{
  if (displayHasBeenInitialized)
  {
    if (color.id < vpColor::id_unknown) {
      cvPutText( background, text, 
		 cvPoint( vpMath::round( ip.get_u() ),
			  vpMath::round( ip.get_v()+fontHeight ) ), 
		 font, col[color.id] );
    }
    else {
      cvcolor = CV_RGB(color.R, color.G, color.B) ;
      cvPutText( background, text, 
		 cvPoint( vpMath::round( ip.get_u() ),
			  vpMath::round( ip.get_v()+fontHeight ) ), 
		 font, cvcolor );
    }
  }
  else
  {
    vpERROR_TRACE("OpenCV not initialized " ) ;
    throw(vpDisplayException(vpDisplayException::notInitializedError,
                             "OpenCV not initialized")) ;
  }
}
开发者ID:GVallicrosa,项目名称:Armed-turtlebot,代码行数:38,代码来源:vpDisplayOpenCV.cpp

示例4: waitForInit

/*!
  \brief flush the Win32 buffer
  It's necessary to use this function to see the results of any drawing

*/
void vpDisplayWin32::flushDisplayROI(const vpImagePoint &iP, const unsigned int width, const unsigned int height)
{
  //waits if the window is not initialized
  waitForInit();
  
  /*
  Under windows, flushing an ROI takes more time than
  flushing the whole image.
  Therefore, we update the maximum area even when asked to update a region.
  */
#ifdef FLUSH_ROI
  typedef struct _half_rect_t{
    unsigned short left_top;
    unsigned short right_bottom;
  } half_rect_t;

  half_rect_t hr1;
  half_rect_t hr2;

  hr1.left_top = (unsigned short)iP.get_u();
  hr1.right_bottom = (unsigned short)(iP.get_u()+width-1);

  hr2.left_top = (unsigned short)iP.get_v();
  hr2.right_bottom = (unsigned short)(iP.get_v()+height-1);

  //sends a message to the window
  WPARAM wp=*((WPARAM*)(&hr1));
  LPARAM lp=*((WPARAM*)(&hr2));
  PostMessage(window.getHWnd(), vpWM_DISPLAY_ROI, wp,lp);
#else
  PostMessage(window.getHWnd(), vpWM_DISPLAY, 0,0);
#endif
}
开发者ID:GVallicrosa,项目名称:Armed-turtlebot,代码行数:38,代码来源:vpDisplayWin32.cpp

示例5: setBottom

/*!
 
  Constructs a rectangle with \e topLeft the top-left corner location
  and \e bottomRight the bottom-right corner.

*/
vpRect::vpRect(const vpImagePoint &topLeft, const vpImagePoint &bottomRight)
{
  this->left = topLeft.get_u();
  this->top = topLeft.get_v();
  
  setBottom( bottomRight.get_v() );
  setRight( bottomRight.get_u() );
};
开发者ID:ILoveFree2,项目名称:visp-deb,代码行数:14,代码来源:vpRect.cpp

示例6: if

bool
vpImageSimulator::getPixel(const vpImagePoint &iP, unsigned char &Ipixelplan)
{
//  std::cout << "In get Pixel" << std::endl;
  //test si pixel dans zone projetee
  bool inside = false;
  for(unsigned int i = 0 ; i < listTriangle.size() ; i++)
      if(listTriangle[i].inTriangle(iP)){
          inside = true;
          break;
      }
  if(!inside) return false;

//  if(!T1.inTriangle(iP) && !T2.inTriangle(iP)){
////      std::cout << "The pixel is inside the projected area" << std::endl;
//    return false;}

  //methoed algebrique
  double z;

  //calcul de la profondeur de l'intersection
  z = distance/(normal_Cam_optim[0]*iP.get_u()+normal_Cam_optim[1]*iP.get_v()+normal_Cam_optim[2]);
  //calcul coordonnees 3D intersection
  Xinter_optim[0]=iP.get_u()*z;
  Xinter_optim[1]=iP.get_v()*z;
  Xinter_optim[2]=z;

  //recuperation des coordonnes de l'intersection dans le plan objet
  //repere plan object : 
  //	centre = X0_2_optim[i] (premier point definissant le plan)
  //	base =  u:(X[1]-X[0]) et v:(X[3]-X[0])
  //ici j'ai considere que le plan est un rectangle => coordonnees sont simplement obtenu par un produit scalaire
  double u = 0, v = 0;
  for(unsigned int i = 0; i < 3; i++)
  {
    double diff = (Xinter_optim[i]-X0_2_optim[i]);
    u += diff*vbase_u_optim[i];
    v += diff*vbase_v_optim[i];
  }
  u = u/(euclideanNorm_u*euclideanNorm_u);
  v = v/(euclideanNorm_v*euclideanNorm_v);

  if( u > 0 && v > 0 && u < 1. && v < 1.)
  {
    double i2,j2;
    i2=v*(Ig.getHeight()-1);
    j2=u*(Ig.getWidth()-1);
    if (interp == BILINEAR_INTERPOLATION)
      Ipixelplan = Ig.getValue(i2,j2);
    else if (interp == SIMPLE)
      Ipixelplan = Ig[(unsigned int)i2][(unsigned int)j2];
    return true;
  }
  else
    return false;
}
开发者ID:976717326,项目名称:visp,代码行数:56,代码来源:vpImageSimulator.cpp

示例7: throw

/*!  
  Display a rectangle.

  \param topLeft : Top-left corner of the rectangle.
  \param bottomRight : Bottom-right corner of the rectangle.
  \param color : Rectangle color.
  \param fill : When set to true fill the rectangle.

  \param thickness : Thickness of the four lines used to display the
  rectangle. This parameter is only useful when \e fill is set to
  false.
*/
void
vpDisplayGTK::displayRectangle ( const vpImagePoint &topLeft,
				 const vpImagePoint &bottomRight,
				 const vpColor &color, bool fill,
				 unsigned int thickness )
{
  if (displayHasBeenInitialized)
  {
    if ( thickness == 1 ) thickness = 0;

    if (color.id < vpColor::id_unknown)
      gdk_gc_set_foreground(gc, col[color.id]);
    else {
      gdkcolor.red   = 256 * color.R;
      gdkcolor.green = 256 * color.G;
      gdkcolor.blue  = 256 * color.B;
      gdk_colormap_alloc_color(colormap,&gdkcolor,FALSE,TRUE);
      gdk_gc_set_foreground(gc, &gdkcolor);     
    }

    gdk_gc_set_line_attributes(gc, (gint)thickness,
			       GDK_LINE_SOLID, GDK_CAP_BUTT,
			       GDK_JOIN_BEVEL) ;

    int w  = vpMath::round( bottomRight.get_u() - topLeft.get_u() );
    int h = vpMath::round( bottomRight.get_v() - topLeft.get_v() );

    if (fill == false)
      gdk_draw_rectangle(background, gc, FALSE,
			 vpMath::round( topLeft.get_u() ),
			 vpMath::round( topLeft.get_v() ),
       w-1,h-1);
    else
      gdk_draw_rectangle(background, gc, TRUE,
			 vpMath::round( topLeft.get_u() ),
			 vpMath::round( topLeft.get_v() ),
       w, h);

    if (thickness > 1)
      gdk_gc_set_line_attributes(gc, 0, GDK_LINE_SOLID, GDK_CAP_BUTT,
                                 GDK_JOIN_BEVEL) ;
  }
  else
  {
    vpERROR_TRACE("GTK not initialized " ) ;
    throw(vpDisplayException(vpDisplayException::notInitializedError,
                             "GTK not initialized")) ;
  }
}
开发者ID:ricsp,项目名称:visp,代码行数:61,代码来源:vpDisplayGTK.cpp

示例8: displayPoint

/*!
  Display a point at the image point \e ip location.
  \param ip : Point location.
  \param color : Point color.
*/
void vpDisplayGTK::displayPoint ( const vpImagePoint &ip,
				  const vpColor &color )
{
  if (displayHasBeenInitialized)
  {
    if (color.id < vpColor::id_unknown)
      gdk_gc_set_foreground(gc, col[color.id]);
    else {
      gdkcolor.red   = 256 * color.R;
      gdkcolor.green = 256 * color.G;
      gdkcolor.blue  = 256 * color.B;
      gdk_colormap_alloc_color(colormap,&gdkcolor,FALSE,TRUE);
      gdk_gc_set_foreground(gc, &gdkcolor);     
    }

    gdk_draw_point(background,gc, 
		   vpMath::round( ip.get_u() ), 
		   vpMath::round( ip.get_v() ) );
  }
  else
  {
    vpERROR_TRACE("GTK not initialized " ) ;
    throw(vpDisplayException(vpDisplayException::notInitializedError,
                             "GTK not initialized")) ;
  }
}
开发者ID:ricsp,项目名称:visp,代码行数:31,代码来源:vpDisplayGTK.cpp

示例9: displayImageROI

/*!
  Display a selection of the gray level image \e I (8bits).

  \warning Display has to be initialized.

  \warning Suppress the overlay drawing in the region of interest.

  \param I : Image to display.
  
  \param iP : Top left corner of the region of interest
  
  \param w : Width of the region of interest
  
  \param h : Height of the region of interest

  \sa init(), closeDisplay()
*/
void vpDisplayGTK::displayImageROI ( const vpImage<unsigned char> &I,const vpImagePoint &iP, const unsigned int w, const unsigned int h )
{
  if (displayHasBeenInitialized)
  {
    vpImage<unsigned char> Itemp;
    vpImageTools::crop(I,(unsigned int)iP.get_i(),(unsigned int)iP.get_j(), h, w,Itemp);
    /* Copie de l'image dans le pixmap fond */
    gdk_draw_gray_image(background,
                        gc, (gint)iP.get_u(), (gint)iP.get_v(), (gint)w, (gint)h,
                        GDK_RGB_DITHER_NONE,
                        I.bitmap,
                        (gint)w);

    /* Le pixmap background devient le fond de la zone de dessin */
    gdk_window_set_back_pixmap(widget->window, background, FALSE);

    /* Affichage */
    //gdk_window_clear(GTK_WINDOW(widget));
    //gdk_flush();
  }
  else
  {
    vpERROR_TRACE("GTK not initialized " ) ;
    throw(vpDisplayException(vpDisplayException::notInitializedError,
                             "GTK not initialized")) ;
  }
}
开发者ID:ricsp,项目名称:visp,代码行数:44,代码来源:vpDisplayGTK.cpp

示例10: displayCharString

/*!
  Display a string at the image point \e ip location.

  To select the font used to display the string, use setFont().

  \param ip : Upper left image point location of the string in the display.
  \param text : String to display in overlay.
  \param color : String color.

  \sa setFont()
*/
void vpDisplayGTK::displayCharString ( const vpImagePoint &ip,
				       const char *text, 
				       const vpColor &color )
{
  if (displayHasBeenInitialized)
  {
    if (color.id < vpColor::id_unknown)
      gdk_gc_set_foreground(gc, col[color.id]);
    else {
      gdkcolor.red   = 256 * color.R;
      gdkcolor.green = 256 * color.G;
      gdkcolor.blue  = 256 * color.B;
      gdk_colormap_alloc_color(colormap,&gdkcolor,FALSE,TRUE);
      gdk_gc_set_foreground(gc, &gdkcolor);     
    }
    if (font != NULL)
      gdk_draw_string(background, font, gc,
                      vpMath::round( ip.get_u() ),
                      vpMath::round( ip.get_v() ),
                      (const gchar *)text);
    else
      std::cout << "Cannot draw string: no font is selected" << std::endl;
  }
  else
  {
    vpERROR_TRACE("GTK not initialized " ) ;
    throw(vpDisplayException(vpDisplayException::notInitializedError,
                             "GTK not initialized")) ;
  }
}
开发者ID:ricsp,项目名称:visp,代码行数:41,代码来源:vpDisplayGTK.cpp

示例11:

/*!
 
  Constructs a rectangle with \e topLeft the top-left corner location
  and \e width and \e height the rectangle size.

*/
vpRect::vpRect(const vpImagePoint &topLeft, double width, double height)
{
  this->left = topLeft.get_u();
  this->top = topLeft.get_v();
  this->width = width;
  this->height = height;
};
开发者ID:ILoveFree2,项目名称:visp-deb,代码行数:13,代码来源:vpRect.cpp

示例12: displayCircle

/*!
  Display a circle.
  \param center : Circle center position.
  \param radius : Circle radius.
  \param color : Circle color.
  \param fill : When set to true fill the circle.
  \param thickness : Thickness of the circle. This parameter is only useful 
  when \e fill is set to false.
*/
void vpDisplayOpenCV::displayCircle(const vpImagePoint &center,
				    unsigned int radius,
				    const vpColor &color,
				    bool  fill ,
				    unsigned int thickness)
{
  if (displayHasBeenInitialized)
  {
    if (fill == false) {
      if (color.id < vpColor::id_unknown) {
	cvCircle( background, 
		  cvPoint( vpMath::round( center.get_u() ), 
			   vpMath::round( center.get_v() ) ), 
		  (int)radius, col[color.id], (int)thickness);
      }
      else {
	cvcolor = CV_RGB(color.R, color.G, color.B) ;
	cvCircle( background, 
		  cvPoint( vpMath::round( center.get_u() ), 
			   vpMath::round( center.get_v() ) ), 
		  (int)radius, cvcolor, (int)thickness);
      }
    }
    else {
      if (color.id < vpColor::id_unknown) {
	cvCircle( background, 
		  cvPoint( vpMath::round( center.get_u() ), 
			   vpMath::round( center.get_v() ) ), 
		  (int)radius, col[color.id], CV_FILLED);
      }
      else {
	cvcolor = CV_RGB(color.R, color.G, color.B) ;
	cvCircle( background, 
		  cvPoint( vpMath::round( center.get_u() ), 
			   vpMath::round( center.get_v() ) ), 
		  (int)radius, cvcolor, CV_FILLED);
      }
    }
  }
  else
  {
    vpERROR_TRACE("OpenCV not initialized " ) ;
    throw(vpDisplayException(vpDisplayException::notInitializedError,
                             "OpenCV not initialized")) ;
  }
}
开发者ID:GVallicrosa,项目名称:Armed-turtlebot,代码行数:55,代码来源:vpDisplayOpenCV.cpp

示例13: cvPoint

/*!  
  Display a rectangle with \e topLeft as the top-left corner and \e
  width and \e height the rectangle size.

  \param topLeft : Top-left corner of the rectangle.
  \param width,height : Rectangle size.
  \param color : Rectangle color.
  \param fill : When set to true fill the rectangle.

  \param thickness : Thickness of the four lines used to display the
  rectangle. This parameter is only useful when \e fill is set to
  false.
*/
void
vpDisplayOpenCV::displayRectangle(const vpImagePoint &topLeft,
                                  unsigned int width, unsigned int height,
                                  const vpColor &color, bool fill,
                                  unsigned int thickness)
{
  if (displayHasBeenInitialized)
  {
    if (fill == false) {
      if (color.id < vpColor::id_unknown) {
	cvRectangle( background,
		     cvPoint( vpMath::round( topLeft.get_u() ),
			      vpMath::round( topLeft.get_v() ) ),
		     cvPoint( vpMath::round( topLeft.get_u()+width ),
			      vpMath::round( topLeft.get_v()+height ) ),
		     col[color.id], (int)thickness);
      }
      else {
	cvcolor = CV_RGB(color.R, color.G, color.B) ;
	cvRectangle( background,
		     cvPoint( vpMath::round( topLeft.get_u() ),
			      vpMath::round( topLeft.get_v() ) ),
		     cvPoint( vpMath::round( topLeft.get_u()+width ),
			      vpMath::round( topLeft.get_v()+height ) ),
		     cvcolor, (int)thickness);
      }
    }
    else {
      if (color.id < vpColor::id_unknown) {
	cvRectangle( background,
		     cvPoint( vpMath::round( topLeft.get_u() ),
			      vpMath::round( topLeft.get_v() ) ),
		     cvPoint( vpMath::round( topLeft.get_u()+width ),
			      vpMath::round( topLeft.get_v()+height ) ),
		     col[color.id], CV_FILLED);
      }
      else {
	cvcolor = CV_RGB(color.R, color.G, color.B) ;
	cvRectangle( background,
		     cvPoint( vpMath::round( topLeft.get_u() ),
			      vpMath::round( topLeft.get_v() ) ),
		     cvPoint( vpMath::round( topLeft.get_u()+width ),
			      vpMath::round( topLeft.get_v()+height ) ),
		     cvcolor, CV_FILLED);

      }
    }
  }
  else
  {
    vpERROR_TRACE("OpenCV not initialized " ) ;
    throw(vpDisplayException(vpDisplayException::notInitializedError,
                             "OpenCV not initialized")) ;
  }
}
开发者ID:GVallicrosa,项目名称:Armed-turtlebot,代码行数:68,代码来源:vpDisplayOpenCV.cpp

示例14:

bool 
vpImageSimulator::getPixelDepth(const vpImagePoint iP,double &Zpixelplan)
{
  //test si pixel dans zone projetee
  if(!T1.inTriangle(iP) && !T2.inTriangle(iP))
    return false;

  Zpixelplan = distance/(normal_Cam_optim[0]*iP.get_u()+normal_Cam_optim[1]*iP.get_v()+normal_Cam_optim[2]);
  return true;
}
开发者ID:nttputus,项目名称:visp,代码行数:10,代码来源:vpImageSimulator.cpp

示例15: displayCircle

/*!
  Display a circle.
  \param center : Circle center position.
  \param radius : Circle radius.
  \param color : Circle color.
  \param fill : When set to true fill the circle.
  \param thickness : Thickness of the circle. This parameter is only useful 
  when \e fill is set to false.
*/
void vpDisplayGTK::displayCircle ( const vpImagePoint &center,
				   unsigned int radius,
				   const vpColor &color,
				   bool fill,
				   unsigned int thickness )
{
  if (displayHasBeenInitialized)
  {
    if ( thickness == 1 ) thickness = 0;

    if (color.id < vpColor::id_unknown)
      gdk_gc_set_foreground(gc, col[color.id]);
    else {
      gdkcolor.red   = 256 * color.R;
      gdkcolor.green = 256 * color.G;
      gdkcolor.blue  = 256 * color.B;
      gdk_colormap_alloc_color(colormap,&gdkcolor,FALSE,TRUE);
      gdk_gc_set_foreground(gc, &gdkcolor);     
    }

    gdk_gc_set_line_attributes(gc, (gint)thickness,
			       GDK_LINE_SOLID, GDK_CAP_BUTT,
			       GDK_JOIN_BEVEL) ;

    if (fill == false)
      gdk_draw_arc(background, gc, FALSE,
		   vpMath::round( center.get_u()-radius ), 
		   vpMath::round( center.get_v()-radius ),
		   (gint)(2*radius), (gint)(2*radius), 23040, 23040) ; /* 23040 = 360*64 */
    else
      gdk_draw_arc(background, gc, TRUE,
		   vpMath::round( center.get_u()-radius ), 
		   vpMath::round( center.get_v()-radius ),
		   (gint)(2*radius), (gint)(2*radius), 23040, 23040) ; /* 23040 = 360*64 */
  }
  else
  {
    vpERROR_TRACE("GTK not initialized " ) ;
    throw(vpDisplayException(vpDisplayException::notInitializedError,
                             "GTK not initialized")) ;
  }
}
开发者ID:ricsp,项目名称:visp,代码行数:51,代码来源:vpDisplayGTK.cpp


注:本文中的vpImagePoint::get_u方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。