ViSP  2.10.0
vpDisplayOpenCV Class Reference

#include <vpDisplayOpenCV.h>

+ Inheritance diagram for vpDisplayOpenCV:

Public Member Functions

 vpDisplayOpenCV ()
 
 vpDisplayOpenCV (int winx, int winy, const char *title=NULL)
 
 vpDisplayOpenCV (vpImage< unsigned char > &I, int winx=-1, int winy=-1, const char *title=NULL)
 
 vpDisplayOpenCV (vpImage< vpRGBa > &I, int winx=-1, int winy=-1, const char *title=NULL)
 
virtual ~vpDisplayOpenCV ()
 
void init (vpImage< unsigned char > &I, int winx=-1, int winy=-1, const char *title=NULL)
 
void init (vpImage< vpRGBa > &I, int winx=-1, int winy=-1, const char *title=NULL)
 
void init (unsigned int width, unsigned int height, int winx=-1, int winy=-1, const char *title=NULL)
 
void getImage (vpImage< vpRGBa > &I)
 
int getWindowXPosition () const
 
int getWindowYPosition () const
 
bool isInitialised ()
 

Static Public Member Functions

Display functionalities on gray level images.
static void displayArrow (const vpImage< unsigned char > &I, const vpImagePoint &ip1, const vpImagePoint &ip2, const vpColor &color=vpColor::white, unsigned int w=4, unsigned int h=2, unsigned int thickness=1)
 
static void displayArrow (const vpImage< unsigned char > &I, int i1, int j1, int i2, int j2, const vpColor &color=vpColor::white, unsigned int w=4, unsigned int h=2, unsigned int thickness=1)
 
static void displayCharString (const vpImage< unsigned char > &I, const vpImagePoint &ip, const char *string, const vpColor &color)
 
static void displayCharString (const vpImage< unsigned char > &I, int i, int j, const char *string, const vpColor &color)
 
static void displayCircle (const vpImage< unsigned char > &I, const vpImagePoint &center, unsigned int radius, const vpColor &color, bool fill=false, unsigned int thickness=1)
 
static void displayCircle (const vpImage< unsigned char > &I, int i, int j, unsigned int radius, const vpColor &color, bool fill=false, unsigned int thickness=1)
 
static void displayCross (const vpImage< unsigned char > &I, const vpImagePoint &ip, unsigned int size, const vpColor &color, unsigned int thickness=1)
 
static void displayCross (const vpImage< unsigned char > &I, int i, int j, unsigned int size, const vpColor &color, unsigned int thickness=1)
 
static void displayDotLine (const vpImage< unsigned char > &I, const vpImagePoint &ip1, const vpImagePoint &ip2, const vpColor &color, unsigned int thickness=1)
 
static void displayDotLine (const vpImage< unsigned char > &I, int i1, int j1, int i2, int j2, const vpColor &color, unsigned int thickness=1)
 
static void displayLine (const vpImage< unsigned char > &I, const vpImagePoint &ip1, const vpImagePoint &ip2, const vpColor &color, unsigned int thickness=1)
 
static void displayLine (const vpImage< unsigned char > &I, int i1, int j1, int i2, int j2, const vpColor &color, unsigned int thickness=1)
 
static void displayPoint (const vpImage< unsigned char > &I, const vpImagePoint &ip, const vpColor &color, unsigned int thickness=1)
 
static void displayPoint (const vpImage< unsigned char > &I, int i, int j, const vpColor &color, unsigned int thickness=1)
 
static void displayRectangle (const vpImage< unsigned char > &I, const vpImagePoint &topLeft, unsigned int width, unsigned int height, const vpColor &color, bool fill=false, unsigned int thickness=1)
 
static void displayRectangle (const vpImage< unsigned char > &I, const vpImagePoint &topLeft, const vpImagePoint &bottomRight, const vpColor &color, bool fill=false, unsigned int thickness=1)
 
static void displayRectangle (const vpImage< unsigned char > &I, const vpRect &rectangle, const vpColor &color, bool fill=false, unsigned int thickness=1)
 
static void displayRectangle (const vpImage< unsigned char > &I, const vpImagePoint &center, float angle, unsigned int width, unsigned int height, const vpColor &color, unsigned int thickness=1)
 
static void displayRectangle (const vpImage< unsigned char > &I, int i, int j, unsigned int width, unsigned int height, const vpColor &color, bool fill=false, unsigned int thickness=1)
 
static void displayRectangle (const vpImage< unsigned char > &I, unsigned int i, unsigned int j, float angle, unsigned int width, unsigned int height, const vpColor &color, unsigned int thickness=1)
 
static bool getClick (const vpImage< unsigned char > &I, bool blocking=true)
 
static bool getClick (const vpImage< unsigned char > &I, vpImagePoint &ip, bool blocking=true)
 
static bool getClick (const vpImage< unsigned char > &I, vpImagePoint &ip, vpMouseButton::vpMouseButtonType &button, bool blocking=true)
 
static bool getClick (const vpImage< unsigned char > &I, vpMouseButton::vpMouseButtonType &button, bool blocking=true)
 
static bool getClickUp (const vpImage< unsigned char > &I, vpImagePoint &ip, vpMouseButton::vpMouseButtonType &button, bool blocking=true)
 
static bool getClickUp (const vpImage< unsigned char > &I, vpMouseButton::vpMouseButtonType &button, bool blocking=true)
 
static bool getKeyboardEvent (const vpImage< unsigned char > &I, bool blocking=true)
 
static bool getKeyboardEvent (const vpImage< unsigned char > &I, char *string, bool blocking=true)
 
static bool getPointerMotionEvent (const vpImage< unsigned char > &I, vpImagePoint &ip)
 
static bool getPointerPosition (const vpImage< unsigned char > &I, vpImagePoint &ip)
 
static void setFont (const vpImage< unsigned char > &I, const char *font)
 
static void setTitle (const vpImage< unsigned char > &I, const char *windowtitle)
 
static void setWindowPosition (const vpImage< unsigned char > &I, int winx, int winy)
 
static void close (vpImage< unsigned char > &I)
 
static void display (const vpImage< unsigned char > &I)
 
static void displayCamera (const vpImage< unsigned char > &I, const vpHomogeneousMatrix &cMo, const vpCameraParameters &cam, double size, const vpColor &color, unsigned int thickness)
 
static void displayEllipse (const vpImage< unsigned char > &I, const vpImagePoint &center, const double &coef1, const double &coef2, const double &coef3, bool use_centered_moments, const vpColor &color, unsigned int thickness=1)
 
static void displayEllipse (const vpImage< unsigned char > &I, const vpImagePoint &center, const double &coef1, const double &coef2, const double &coef3, const double &theta1, const double &theta2, bool use_centered_moments, const vpColor &color, unsigned int thickness=1)
 
static void displayFrame (const vpImage< unsigned char > &I, const vpHomogeneousMatrix &cMo, const vpCameraParameters &cam, double size, const vpColor &color=vpColor::none, unsigned int thickness=1)
 
static void displayPolygon (const vpImage< unsigned char > &I, const std::vector< vpImagePoint > &vip, const vpColor &color, unsigned int thickness=1)
 
static void displayROI (const vpImage< unsigned char > &I, const vpRect &roi)
 
static void displayText (const vpImage< unsigned char > &I, const vpImagePoint &ip, const std::string &s, const vpColor &color)
 
static void displayText (const vpImage< unsigned char > &I, int i, int j, const std::string &s, const vpColor &color)
 
static void flush (const vpImage< unsigned char > &I)
 
static void flushROI (const vpImage< unsigned char > &I, const vpRect &roi)
 
static void getImage (const vpImage< unsigned char > &Is, vpImage< vpRGBa > &Id)
 
static void setBackground (const vpImage< unsigned char > &I, const vpColor &color)
 
Display functionalities on color images.
static void displayArrow (const vpImage< vpRGBa > &I, const vpImagePoint &ip1, const vpImagePoint &ip2, const vpColor &color=vpColor::white, unsigned int w=4, unsigned int h=2, unsigned int thickness=1)
 
static void displayArrow (const vpImage< vpRGBa > &I, int i1, int j1, int i2, int j2, const vpColor &color=vpColor::white, unsigned int w=4, unsigned int h=2, unsigned int thickness=1)
 
static void displayCharString (const vpImage< vpRGBa > &I, const vpImagePoint &ip, const char *string, const vpColor &color)
 
static void displayCharString (const vpImage< vpRGBa > &I, int i, int j, const char *string, const vpColor &color)
 
static void displayCircle (const vpImage< vpRGBa > &I, const vpImagePoint &center, unsigned int radius, const vpColor &color, bool fill=false, unsigned int thickness=1)
 
static void displayCircle (const vpImage< vpRGBa > &I, int i, int j, unsigned int radius, const vpColor &color, bool fill=false, unsigned int thickness=1)
 
static void displayCross (const vpImage< vpRGBa > &I, const vpImagePoint &ip, unsigned int size, const vpColor &color, unsigned int thickness=1)
 
static void displayCross (const vpImage< vpRGBa > &I, int i, int j, unsigned int size, const vpColor &color, unsigned int thickness=1)
 
static void displayDotLine (const vpImage< vpRGBa > &I, const vpImagePoint &ip1, const vpImagePoint &ip2, const vpColor &color, unsigned int thickness=1)
 
static void displayDotLine (const vpImage< vpRGBa > &I, int i1, int j1, int i2, int j2, const vpColor &color, unsigned int thickness=1)
 
static void displayLine (const vpImage< vpRGBa > &I, const vpImagePoint &ip1, const vpImagePoint &ip2, const vpColor &color, unsigned int thickness=1)
 
static void displayLine (const vpImage< vpRGBa > &I, int i1, int j1, int i2, int j2, const vpColor &color, unsigned int thickness=1)
 
static void displayPoint (const vpImage< vpRGBa > &I, const vpImagePoint &ip, const vpColor &color, unsigned int thickness=1)
 
static void displayPoint (const vpImage< vpRGBa > &I, int i, int j, const vpColor &color, unsigned int thickness=1)
 
static void displayRectangle (const vpImage< vpRGBa > &I, const vpImagePoint &topLeft, unsigned int width, unsigned int height, const vpColor &color, bool fill=false, unsigned int thickness=1)
 
static void displayRectangle (const vpImage< vpRGBa > &I, const vpImagePoint &topLeft, const vpImagePoint &bottomRight, const vpColor &color, bool fill=false, unsigned int thickness=1)
 
static void displayRectangle (const vpImage< vpRGBa > &I, const vpRect &rectangle, const vpColor &color, bool fill=false, unsigned int thickness=1)
 
static void displayRectangle (const vpImage< vpRGBa > &I, const vpImagePoint &center, float angle, unsigned int width, unsigned int height, const vpColor &color, unsigned int thickness=1)
 
static void displayRectangle (const vpImage< vpRGBa > &I, int i, int j, unsigned int width, unsigned int height, const vpColor &color, bool fill=false, unsigned int thickness=1)
 
static void displayRectangle (const vpImage< vpRGBa > &I, unsigned int i, unsigned int j, float angle, unsigned int width, unsigned int height, const vpColor &color, unsigned int thickness=1)
 
static bool getClick (const vpImage< vpRGBa > &I, bool blocking=true)
 
static bool getClick (const vpImage< vpRGBa > &I, vpImagePoint &ip, bool blocking=true)
 
static bool getClick (const vpImage< vpRGBa > &I, vpImagePoint &ip, vpMouseButton::vpMouseButtonType &button, bool blocking=true)
 
static bool getClick (const vpImage< vpRGBa > &I, vpMouseButton::vpMouseButtonType &button, bool blocking=true)
 
static bool getClickUp (const vpImage< vpRGBa > &I, vpImagePoint &ip, vpMouseButton::vpMouseButtonType &button, bool blocking=true)
 
static bool getClickUp (const vpImage< vpRGBa > &I, vpMouseButton::vpMouseButtonType &button, bool blocking=true)
 
static bool getKeyboardEvent (const vpImage< vpRGBa > &I, bool blocking=true)
 
static bool getKeyboardEvent (const vpImage< vpRGBa > &I, char *string, bool blocking=true)
 
static bool getPointerMotionEvent (const vpImage< vpRGBa > &I, vpImagePoint &ip)
 
static bool getPointerPosition (const vpImage< vpRGBa > &I, vpImagePoint &ip)
 
static void setFont (const vpImage< vpRGBa > &I, const char *font)
 
static void setTitle (const vpImage< vpRGBa > &I, const char *windowtitle)
 
static void setWindowPosition (const vpImage< vpRGBa > &I, int winx, int winy)
 
static void close (vpImage< vpRGBa > &I)
 
static void display (const vpImage< vpRGBa > &I)
 
static void displayCamera (const vpImage< vpRGBa > &I, const vpHomogeneousMatrix &cMo, const vpCameraParameters &cam, double size, const vpColor &color, unsigned int thickness)
 
static void displayEllipse (const vpImage< vpRGBa > &I, const vpImagePoint &center, const double &coef1, const double &coef2, const double &coef3, bool use_centered_moments, const vpColor &color, unsigned int thickness=1)
 
static void displayEllipse (const vpImage< vpRGBa > &I, const vpImagePoint &center, const double &coef1, const double &coef2, const double &coef3, const double &angle1, const double &angle2, bool use_centered_moments, const vpColor &color, unsigned int thickness=1)
 
static void displayFrame (const vpImage< vpRGBa > &I, const vpHomogeneousMatrix &cMo, const vpCameraParameters &cam, double size, const vpColor &color=vpColor::none, unsigned int thickness=1)
 
static void displayPolygon (const vpImage< vpRGBa > &I, const std::vector< vpImagePoint > &vip, const vpColor &color, unsigned int thickness=1)
 
static void displayROI (const vpImage< vpRGBa > &I, const vpRect &roi)
 
static void displayText (const vpImage< vpRGBa > &I, const vpImagePoint &ip, const std::string &s, const vpColor &color)
 
static void displayText (const vpImage< vpRGBa > &I, int i, int j, const std::string &s, const vpColor &color)
 
static void flush (const vpImage< vpRGBa > &I)
 
static void flushROI (const vpImage< vpRGBa > &I, const vpRect &roi)
 
static void getImage (const vpImage< vpRGBa > &Is, vpImage< vpRGBa > &Id)
 
static void setBackground (const vpImage< vpRGBa > &I, const vpColor &color)
 

Protected Member Functions

void setFont (const char *font)
 
void setTitle (const char *title)
 
void setWindowPosition (int winx, int winy)
 
void clearDisplay (const vpColor &color=vpColor::white)
 
void closeDisplay ()
 
void displayArrow (const vpImagePoint &ip1, const vpImagePoint &ip2, const vpColor &color=vpColor::white, unsigned int w=4, unsigned int h=2, unsigned int thickness=1)
 
void displayCharString (const vpImagePoint &ip, const char *text, const vpColor &color=vpColor::green)
 
void displayCircle (const vpImagePoint &center, unsigned int radius, const vpColor &color, bool fill=false, unsigned int thickness=1)
 
void displayCross (const vpImagePoint &ip, unsigned int size, const vpColor &color, unsigned int thickness=1)
 
void displayDotLine (const vpImagePoint &ip1, const vpImagePoint &ip2, const vpColor &color, unsigned int thickness=1)
 
void displayImage (const vpImage< vpRGBa > &I)
 
void displayImage (const vpImage< unsigned char > &I)
 
void displayImage (const unsigned char *I)
 
void displayImageROI (const vpImage< unsigned char > &I, const vpImagePoint &iP, const unsigned int width, const unsigned int height)
 
void displayImageROI (const vpImage< vpRGBa > &I, const vpImagePoint &iP, const unsigned int width, const unsigned int height)
 
void displayLine (const vpImagePoint &ip1, const vpImagePoint &ip2, const vpColor &color, unsigned int thickness=1)
 
void displayPoint (const vpImagePoint &ip, const vpColor &color)
 
void displayRectangle (const vpImagePoint &topLeft, unsigned int width, unsigned int height, const vpColor &color, bool fill=false, unsigned int thickness=1)
 
void displayRectangle (const vpImagePoint &topLeft, const vpImagePoint &bottomRight, const vpColor &color, bool fill=false, unsigned int thickness=1)
 
void displayRectangle (const vpRect &rectangle, const vpColor &color, bool fill=false, unsigned int thickness=1)
 
void flushDisplay ()
 
void flushDisplayROI (const vpImagePoint &iP, const unsigned int width, const unsigned int height)
 
bool getClick (bool blocking=true)
 
bool getClick (vpImagePoint &ip, bool blocking=true)
 
bool getClick (vpImagePoint &ip, vpMouseButton::vpMouseButtonType &button, bool blocking=true)
 
bool getClickUp (vpImagePoint &ip, vpMouseButton::vpMouseButtonType &button, bool blocking=true)
 
unsigned int getWidth () const
 
unsigned int getHeight () const
 
bool getKeyboardEvent (bool blocking=true)
 
bool getKeyboardEvent (char *string, bool blocking=true)
 
bool getPointerMotionEvent (vpImagePoint &ip)
 
bool getPointerPosition (vpImagePoint &ip)
 

Static Protected Member Functions

static void on_mouse (int event, int x, int y, int flags, void *param)
 

Protected Attributes

bool displayHasBeenInitialized
 
int windowXPosition
 
int windowYPosition
 
unsigned int width
 
unsigned int height
 
std::string title_
 

Detailed Description

The vpDisplayOpenCV allows to display image using the opencv library.

The example below shows how to display an image with this video device.

#include <visp/vpConfig.h>
#include <visp/vpImageIo.h>
#include <visp/vpDisplayOpenCV.h>
#include <visp/vpImagePoint.h>
int main()
{
#if defined(VISP_HAVE_OPENCV)
vpImage<unsigned char> I; // Grey level image
// Read an image in PGM P5 format
vpImageIo::read(I, "/local/soft/ViSP/ViSP-images/Klimt/Klimt.pgm");
// Initialize the display with the image I. Display and image are
// now link together.
d.init(I);
// Specify the window location
// Set the display window title
vpDisplay::setTitle(I, "My OpenCV display");
// Set the display background with image I content
// Draw a red rectangle in the display overlay (foreground)
vpDisplay::displayRectangle(I, 10, 10, 100, 20, vpColor::red, true);
// Draw a red rectangle in the display overlay (foreground)
vpImagePoint topLeftCorner;
topLeftCorner.set_i(10);
topLeftCorner.set_j(50);
vpDisplay::displayRectangle(I, topLeftCorner, 100, 20, vpColor::green, true);
// Flush the foreground and background display
// Get non blocking keyboard events
std::cout << "Check keyboard events..." << std::endl;
char key[10];
bool ret;
for (int i=0; i< 200; i++) {
bool ret = vpDisplay::getKeyboardEvent(I, key, false);
if (ret)
std::cout << "keyboard event: key: " << "\"" << key << "\"" << std::endl;
}
// Get a blocking keyboard event
std::cout << "Wait for a keyboard event..." << std::endl;
ret = vpDisplay::getKeyboardEvent(I, key, true);
std::cout << "keyboard event: " << ret << std::endl;
if (ret)
std::cout << "key: " << "\"" << key << "\"" << std::endl;
// Wait for a click in the display window
std::cout << "Wait for a button click..." << std::endl;
#endif
}
Examples:
AROgre.cpp, AROgreBasic.cpp, BSpline.cpp, displayOpenCV.cpp, grab1394CMU.cpp, grabOpenCV-2.cpp, imageSequenceReader.cpp, kinectAcquisition.cpp, mbtEdgeKltTracking.cpp, mbtEdgeTracking.cpp, mbtKltTracking.cpp, Nurbs.cpp, photometricVisualServoing.cpp, poseVirtualVS.cpp, servoAfma4Point2DArtVelocity.cpp, servoAfma4Point2DCamVelocity.cpp, servoAfma4Point2DCamVelocityKalman.cpp, servoAfma62DhalfCamVelocity.cpp, servoAfma6Cylinder2DCamVelocity.cpp, servoAfma6Cylinder2DCamVelocitySecondaryTask.cpp, servoAfma6Ellipse2DCamVelocity.cpp, servoAfma6FourPoints2DArtVelocity.cpp, servoAfma6FourPoints2DCamVelocityInteractionCurrent.cpp, servoAfma6FourPoints2DCamVelocityInteractionDesired.cpp, servoAfma6Line2DCamVelocity.cpp, servoAfma6Point2DArtVelocity.cpp, servoAfma6Point2DCamVelocity.cpp, servoAfma6Points2DCamVelocityEyeToHand.cpp, servoAfma6Segment2DCamVelocity.cpp, servoAfma6SquareLines2DCamVelocity.cpp, servoAfma6TwoLines2DCamVelocity.cpp, servoMomentImage.cpp, servoMomentPoints.cpp, servoMomentPolygon.cpp, servoSimu4Points.cpp, servoSimuAfma6FourPoints2DCamVelocity.cpp, servoSimuCircle2DCamVelocityDisplay.cpp, servoSimuCylinder.cpp, servoSimuCylinder2DCamVelocityDisplay.cpp, servoSimuCylinder2DCamVelocityDisplaySecondaryTask.cpp, servoSimuFourPoints2DCamVelocityDisplay.cpp, servoSimuFourPoints2DPolarCamVelocityDisplay.cpp, servoSimuLine2DCamVelocityDisplay.cpp, servoSimuSphere.cpp, servoSimuSquareLine2DCamVelocityDisplay.cpp, servoSimuViper850FourPoints2DCamVelocity.cpp, servoViper650FourPoints2DArtVelocityInteractionCurrent.cpp, servoViper650FourPoints2DCamVelocityInteractionCurrent.cpp, servoViper850FourPoints2DArtVelocityInteractionCurrent.cpp, servoViper850FourPoints2DArtVelocityInteractionDesired.cpp, servoViper850FourPoints2DCamVelocityInteractionCurrent.cpp, servoViper850FourPointsKinect.cpp, servoViper850Point2DArtVelocity-jointAvoidance-basic.cpp, servoViper850Point2DArtVelocity-jointAvoidance-gpa.cpp, servoViper850Point2DArtVelocity.cpp, servoViper850Point2DCamVelocity.cpp, servoViper850Point2DCamVelocityKalman.cpp, templateTracker.cpp, testClick.cpp, testDisplayRoi.cpp, testDisplays.cpp, testRobotAfma6Pose.cpp, testRobotViper850Pose.cpp, testVideoDevice.cpp, testVideoDeviceDual.cpp, trackDot.cpp, trackDot2.cpp, trackDot2WithAutoDetection.cpp, trackKltOpencv.cpp, trackMeCircle.cpp, trackMeEllipse.cpp, trackMeLine.cpp, trackMeNurbs.cpp, tutorial-barcode-detector-live.cpp, tutorial-barcode-detector.cpp, tutorial-blob-auto-tracker.cpp, tutorial-blob-tracker-live-firewire.cpp, tutorial-blob-tracker-live-v4l2.cpp, tutorial-detection-object-mbt.cpp, tutorial-face-detector-live.cpp, tutorial-face-detector.cpp, tutorial-grabber-opencv-bis.cpp, tutorial-grabber-opencv.cpp, tutorial-ibvs-4pts-display.cpp, tutorial-ibvs-4pts-image-tracking.cpp, tutorial-ibvs-4pts-ogre-tracking.cpp, tutorial-ibvs-4pts-wireframe-camera.cpp, tutorial-ibvs-4pts-wireframe-robot-afma6.cpp, tutorial-ibvs-4pts-wireframe-robot-viper.cpp, tutorial-image-filter.cpp, tutorial-image-simulator.cpp, tutorial-image-viewer.cpp, tutorial-klt-tracker-live-v4l2.cpp, tutorial-klt-tracker-with-reinit.cpp, tutorial-klt-tracker.cpp, tutorial-matching-keypoint-homography.cpp, tutorial-matching-keypoint-SIFT.cpp, tutorial-matching-keypoint.cpp, tutorial-matching-surf-deprecated.cpp, tutorial-matching-surf-homography-deprecated.cpp, tutorial-mb-edge-tracker.cpp, tutorial-mb-hybrid-tracker.cpp, tutorial-mb-klt-tracker.cpp, tutorial-me-ellipse-tracker.cpp, tutorial-me-line-tracker.cpp, tutorial-pose-from-points-image.cpp, tutorial-pose-from-points-tracking.cpp, tutorial-template-tracker.cpp, tutorial-video-reader.cpp, tutorial-video-recorder.cpp, tutorial-viewer.cpp, videoReader.cpp, and wireframeSimulator.cpp.

Definition at line 144 of file vpDisplayOpenCV.h.

Constructor & Destructor Documentation

vpDisplayOpenCV::vpDisplayOpenCV ( )

Basic constructor.

To initialize the window position, title and size you may call init(vpImage<unsigned char> &, int, int, const char *) or init(vpImage<vpRGBa> &, int, int, const char *).

#include <visp/vpDisplayOpenCV.h>
#include <visp/vpImage.h>
int main()
{
d.init(I, 100, 200, "My display");
}

Definition at line 230 of file vpDisplayOpenCV.cpp.

vpDisplayOpenCV::vpDisplayOpenCV ( int  x,
int  y,
const char *  title = NULL 
)

Constructor that just initialize the display position in the screen and the display title.

Parameters
x,y: The window is set at position x,y (column index, row index).
title: Window title.

To initialize the display size, you need to call init().

#include <visp/vpDisplayOpenCV.h>
#include <visp/vpImage.h>
int main()
{
vpDisplayOpenCV d(100, 200, "My display");
d.init(I);
}

Definition at line 166 of file vpDisplayOpenCV.cpp.

References vpDisplay::title_, vpDisplay::windowXPosition, and vpDisplay::windowYPosition.

vpDisplayOpenCV::vpDisplayOpenCV ( vpImage< unsigned char > &  I,
int  x = -1,
int  y = -1,
const char *  title = NULL 
)

Constructor. Initialize a display to visualize a gray level image (8 bits).

Parameters
I: Image to be displayed (not that image has to be initialized)
x,y: The window is set at position x,y (column index, row index).
title: Window title.

Definition at line 93 of file vpDisplayOpenCV.cpp.

References init().

vpDisplayOpenCV::vpDisplayOpenCV ( vpImage< vpRGBa > &  I,
int  x = -1,
int  y = -1,
const char *  title = NULL 
)

Constructor. Initialize a display to visualize a RGBa level image (32 bits).

Parameters
I: Image to be displayed (not that image has to be initialized)
x,y: The window is set at position x,y (column index, row index).
title: Window title.

Definition at line 123 of file vpDisplayOpenCV.cpp.

References init().

vpDisplayOpenCV::~vpDisplayOpenCV ( )
virtual

Destructor.

Definition at line 250 of file vpDisplayOpenCV.cpp.

References closeDisplay().

Member Function Documentation

void vpDisplayOpenCV::clearDisplay ( const vpColor color = vpColor::white)
protectedvirtual
Warning
Not implemented yet.

Implements vpDisplay.

Definition at line 902 of file vpDisplayOpenCV.cpp.

References vpTRACE.

void vpDisplay::close ( vpImage< unsigned char > &  I)
staticinherited
void vpDisplay::close ( vpImage< vpRGBa > &  I)
staticinherited

Close the display attached to I.

Definition at line 2612 of file vpDisplay.cpp.

References vpDisplay::closeDisplay(), vpImage< Type >::display, and vpERROR_TRACE.

void vpDisplayOpenCV::closeDisplay ( )
protectedvirtual

Close the window.

See also
init()

Implements vpDisplay.

Definition at line 814 of file vpDisplayOpenCV.cpp.

References vpDisplay::displayHasBeenInitialized, and vpDisplay::title_.

Referenced by ~vpDisplayOpenCV().

void vpDisplay::display ( const vpImage< unsigned char > &  I)
staticinherited

Display the gray level image I (8bits).

Warning
Display has to be initialized.
Suppress the overlay drawing.
Parameters
I: Image to display.
See also
init(), close()
Examples:
AROgre.cpp, AROgreBasic.cpp, BSpline.cpp, displayD3D.cpp, displayGTK.cpp, displayOpenCV.cpp, displaySequence.cpp, displayX.cpp, displayXMulti.cpp, fernClassifier.cpp, grab1394CMU.cpp, grab1394Two.cpp, grabDirectShow.cpp, grabDirectShowMulti.cpp, grabDisk.cpp, grabOpenCV-2.cpp, grabV4l2.cpp, imageSequenceReader.cpp, keyPointSurf.cpp, kinectAcquisition.cpp, manDisplay.cpp, manGeometricFeatures.cpp, manServo4PointsDisplay.cpp, manSimu4Dots.cpp, mbtEdgeKltTracking.cpp, mbtEdgeTracking.cpp, mbtKltTracking.cpp, Nurbs.cpp, photometricVisualServoing.cpp, planarObjectDetector.cpp, poseVirtualVS.cpp, servoAfma4Point2DArtVelocity.cpp, servoAfma4Point2DCamVelocity.cpp, servoAfma4Point2DCamVelocityKalman.cpp, servoAfma62DhalfCamVelocity.cpp, servoAfma6Cylinder2DCamVelocity.cpp, servoAfma6Cylinder2DCamVelocitySecondaryTask.cpp, servoAfma6Ellipse2DCamVelocity.cpp, servoAfma6FourPoints2DArtVelocity.cpp, servoAfma6FourPoints2DCamVelocityInteractionCurrent.cpp, servoAfma6FourPoints2DCamVelocityInteractionDesired.cpp, servoAfma6Line2DCamVelocity.cpp, servoAfma6Point2DArtVelocity.cpp, servoAfma6Point2DCamVelocity.cpp, servoAfma6Points2DCamVelocityEyeToHand.cpp, servoAfma6Segment2DCamVelocity.cpp, servoAfma6SquareLines2DCamVelocity.cpp, servoAfma6TwoLines2DCamVelocity.cpp, servoBiclopsPoint2DArtVelocity.cpp, servoMomentImage.cpp, servoMomentPoints.cpp, servoMomentPolygon.cpp, servoPioneerPanSegment3D.cpp, servoPioneerPoint2DDepth.cpp, servoPioneerPoint2DDepthWithoutVpServo.cpp, servoPtu46Point2DArtVelocity.cpp, servoSimu4Points.cpp, servoSimuAfma6FourPoints2DCamVelocity.cpp, servoSimuCircle2DCamVelocityDisplay.cpp, servoSimuCylinder.cpp, servoSimuCylinder2DCamVelocityDisplay.cpp, servoSimuCylinder2DCamVelocityDisplaySecondaryTask.cpp, servoSimuFourPoints2DCamVelocityDisplay.cpp, servoSimuFourPoints2DPolarCamVelocityDisplay.cpp, servoSimuLine2DCamVelocityDisplay.cpp, servoSimuSphere.cpp, servoSimuSquareLine2DCamVelocityDisplay.cpp, servoSimuViper850FourPoints2DCamVelocity.cpp, servoViper650FourPoints2DArtVelocityInteractionCurrent.cpp, servoViper650FourPoints2DCamVelocityInteractionCurrent.cpp, servoViper650Point2DCamVelocity.cpp, servoViper850FourPoints2DArtVelocityInteractionCurrent.cpp, servoViper850FourPoints2DArtVelocityInteractionDesired.cpp, servoViper850FourPoints2DCamVelocityInteractionCurrent.cpp, servoViper850FourPointsKinect.cpp, servoViper850Point2DArtVelocity-jointAvoidance-basic.cpp, servoViper850Point2DArtVelocity-jointAvoidance-gpa.cpp, servoViper850Point2DArtVelocity.cpp, servoViper850Point2DCamVelocity.cpp, servoViper850Point2DCamVelocityKalman.cpp, SickLDMRS-Process.cpp, sonarPioneerReader.cpp, templateTracker.cpp, testClick.cpp, testDisplayRoi.cpp, testDisplays.cpp, testFeatureSegment.cpp, testMouseEvent.cpp, testRobotAfma6Pose.cpp, testRobotViper850Pose.cpp, testSurfKeyPoint.cpp, testTrackDot.cpp, testVideoDevice.cpp, testVideoDeviceDual.cpp, trackDot.cpp, trackDot2.cpp, trackDot2WithAutoDetection.cpp, trackKltOpencv.cpp, trackMeCircle.cpp, trackMeEllipse.cpp, trackMeLine.cpp, trackMeNurbs.cpp, tutorial-barcode-detector-live.cpp, tutorial-barcode-detector.cpp, tutorial-blob-auto-tracker.cpp, tutorial-blob-tracker-live-firewire.cpp, tutorial-blob-tracker-live-v4l2.cpp, tutorial-detection-object-mbt.cpp, tutorial-face-detector-live.cpp, tutorial-face-detector.cpp, tutorial-grabber-1394-writer.cpp, tutorial-grabber-1394.cpp, tutorial-grabber-CMU1394.cpp, tutorial-grabber-opencv-bis.cpp, tutorial-grabber-opencv.cpp, tutorial-grabber-v4l2.cpp, tutorial-ibvs-4pts-display.cpp, tutorial-ibvs-4pts-image-tracking.cpp, tutorial-ibvs-4pts-ogre-tracking.cpp, tutorial-ibvs-4pts-wireframe-camera.cpp, tutorial-ibvs-4pts-wireframe-robot-afma6.cpp, tutorial-ibvs-4pts-wireframe-robot-viper.cpp, tutorial-image-filter.cpp, tutorial-image-simulator.cpp, tutorial-image-viewer.cpp, tutorial-klt-tracker-live-v4l2.cpp, tutorial-klt-tracker-with-reinit.cpp, tutorial-klt-tracker.cpp, tutorial-matching-keypoint-homography.cpp, tutorial-matching-keypoint-SIFT.cpp, tutorial-matching-keypoint.cpp, tutorial-matching-surf-deprecated.cpp, tutorial-matching-surf-homography-deprecated.cpp, tutorial-mb-edge-tracker.cpp, tutorial-mb-hybrid-tracker.cpp, tutorial-mb-klt-tracker.cpp, tutorial-me-ellipse-tracker.cpp, tutorial-me-line-tracker.cpp, tutorial-pose-from-points-image.cpp, tutorial-pose-from-points-tracking.cpp, tutorial-template-tracker.cpp, tutorial-video-reader.cpp, tutorial-video-recorder.cpp, tutorial-viewer.cpp, videoReader.cpp, and wireframeSimulator.cpp.

Definition at line 210 of file vpDisplay.cpp.

References vpImage< Type >::display, vpDisplay::displayImage(), and vpERROR_TRACE.

Referenced by vpDot2::defineDots(), vpWireFrameSimulator::getExternalImage(), vpWireFrameSimulator::getInternalImage(), vpPlot::init(), vpMbTracker::initClick(), vpSimulatorAfma6::setPosition(), vpSimulatorAfma6::updateArticularPosition(), and vpSimulatorViper850::updateArticularPosition().

void vpDisplay::display ( const vpImage< vpRGBa > &  I)
staticinherited

Display the color image I in RGBa format (32bits).

Warning
Display has to be initialized.
Suppress the overlay drawing.
Parameters
I: Image to display.
See also
init(), close()

Definition at line 2409 of file vpDisplay.cpp.

References vpImage< Type >::display, vpDisplay::displayImage(), and vpERROR_TRACE.

void vpDisplayOpenCV::displayArrow ( const vpImagePoint ip1,
const vpImagePoint ip2,
const vpColor color = vpColor::white,
unsigned int  w = 4,
unsigned int  h = 2,
unsigned int  thickness = 1 
)
protectedvirtual

Display an arrow from image point ip1 to image point ip2.

Parameters
ip1,ip2: Initial and final image point.
color: Arrow color.
w,h: Width and height of the arrow.
thickness: Thickness of the lines used to display the arrow.

Implements vpDisplay.

Definition at line 918 of file vpDisplayOpenCV.cpp.

References vpDisplay::displayHasBeenInitialized, displayLine(), vpImagePoint::distance(), vpImagePoint::get_i(), vpImagePoint::get_j(), vpDisplayException::notInitializedError, vpImagePoint::set_i(), vpImagePoint::set_j(), vpMath::sqr(), and vpERROR_TRACE.

void vpDisplay::displayArrow ( const vpImage< unsigned char > &  I,
const vpImagePoint ip1,
const vpImagePoint ip2,
const vpColor color = vpColor::white,
unsigned int  w = 4,
unsigned int  h = 2,
unsigned int  thickness = 1 
)
staticinherited

Display an arrow from image point ip1 to image point ip2.

Parameters
I: The image associated to the display.
ip1,ip2: Initial and final image points.
color: Arrow color.
w,h: Width and height of the arrow.
thickness: Thickness of the lines used to display the arrow.

Definition at line 604 of file vpDisplay.cpp.

References vpImage< Type >::display, vpDisplay::displayArrow(), and vpERROR_TRACE.

void vpDisplay::displayArrow ( const vpImage< unsigned char > &  I,
int  i1,
int  j1,
int  i2,
int  j2,
const vpColor color = vpColor::white,
unsigned int  w = 4,
unsigned int  h = 2,
unsigned int  thickness = 1 
)
staticinherited

Display an arrow from image point (i1,j1) to image point (i2,j2).

Parameters
I: The image associated to the display.
i1,j1: Initial image point.
i2,j2: Final image point.
color: Arrow color.
w,h: Width and height of the arrow.
thickness: Thickness of the lines used to display the arrow.

Definition at line 665 of file vpDisplay.cpp.

References vpImage< Type >::display, vpDisplay::displayArrow(), vpImagePoint::set_i(), vpImagePoint::set_j(), and vpERROR_TRACE.

void vpDisplay::displayArrow ( const vpImage< vpRGBa > &  I,
const vpImagePoint ip1,
const vpImagePoint ip2,
const vpColor color = vpColor::white,
unsigned int  w = 4,
unsigned int  h = 2,
unsigned int  thickness = 1 
)
staticinherited

Display an arrow from image point ip1 to image point ip2.

Parameters
I: The image associated to the display.
ip1,ip2: Initial and final image points.
color: Arrow color.
w,h: Width and height of the arrow.
thickness: Thickness of the lines used to display the arrow.

Definition at line 634 of file vpDisplay.cpp.

References vpImage< Type >::display, vpDisplay::displayArrow(), and vpERROR_TRACE.

void vpDisplay::displayArrow ( const vpImage< vpRGBa > &  I,
int  i1,
int  j1,
int  i2,
int  j2,
const vpColor color = vpColor::white,
unsigned int  w = 4,
unsigned int  h = 2,
unsigned int  thickness = 1 
)
staticinherited

Display an arrow from image point (i1,j1) to image point (i2,j2).

Parameters
I: The image associated to the display.
i1,j1: Initial image point.
i2,j2: Final image point.
color: Arrow color.
w,h: Width and height of the arrow.
thickness: Thickness of the lines used to display the arrow.

Definition at line 703 of file vpDisplay.cpp.

References vpImage< Type >::display, vpDisplay::displayArrow(), vpImagePoint::set_i(), vpImagePoint::set_j(), and vpERROR_TRACE.

void vpDisplay::displayCamera ( const vpImage< unsigned char > &  I,
const vpHomogeneousMatrix cMo,
const vpCameraParameters cam,
double  size,
const vpColor color,
unsigned int  thickness 
)
staticinherited

Display the projection of an object camera represented by a cone in the image.

Parameters
I: The image associated to the display.
cMo: Homogeneous matrix that gives the transformation between the camera frame and the object frame to project in the image.
cam: Camera intrinsic parameters.
size: Size of the object camera.
color: Color used to display the camera in the image.
thickness: Thickness of the graphics drawing.

Definition at line 513 of file vpDisplay.cpp.

References vpMeterPixelConversion::convertPoint(), vpDisplay::displayLine(), and vpPoint::setWorldCoordinates().

Referenced by vpSimulatorAfma6::updateArticularPosition(), and vpSimulatorViper850::updateArticularPosition().

void vpDisplay::displayCamera ( const vpImage< vpRGBa > &  I,
const vpHomogeneousMatrix cMo,
const vpCameraParameters cam,
double  size,
const vpColor color,
unsigned int  thickness 
)
staticinherited

Display the projection of an object camera represented by a cone in the image.

Parameters
I: The image associated to the display.
cMo: Homogeneous matrix that gives the transformation between the camera frame and the object frame to project in the image.
cam: Camera intrinsic parameters.
size: Size of the object camera.
color: Color used to display the camera in the image.
thickness: Thickness of the graphics drawing.

Definition at line 565 of file vpDisplay.cpp.

References vpMeterPixelConversion::convertPoint(), vpDisplay::displayLine(), and vpPoint::setWorldCoordinates().

void vpDisplayOpenCV::displayCharString ( const vpImagePoint ip,
const char *  text,
const vpColor color = vpColor::green 
)
protectedvirtual

Display a string at the image point ip location.

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

Parameters
ip: Upper left image point location of the string in the display.
text: String to display in overlay.
color: String color.
See also
setFont()

Implements vpDisplay.

Definition at line 987 of file vpDisplayOpenCV.cpp.

References vpRGBa::B, vpDisplay::displayHasBeenInitialized, vpRGBa::G, vpImagePoint::get_u(), vpImagePoint::get_v(), vpColor::id, vpColor::id_unknown, vpDisplayException::notInitializedError, vpRGBa::R, vpMath::round(), and vpERROR_TRACE.

void vpDisplay::displayCharString ( const vpImage< unsigned char > &  I,
const vpImagePoint ip,
const char *  string,
const vpColor color 
)
staticinherited

Display a string at the image point ip location. Use rather displayText() that does the same.

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

Parameters
I: Image associated to the display.
ip: Upper left image point location of the string in the display.
string: String to display in overlay.
color: String color.
See also
setFont(), displayText()

Definition at line 745 of file vpDisplay.cpp.

References vpImage< Type >::display, vpDisplay::displayCharString(), and vpERROR_TRACE.

void vpDisplay::displayCharString ( const vpImage< unsigned char > &  I,
int  i,
int  j,
const char *  string,
const vpColor color 
)
staticinherited

Display a string at the image point (i,j) location. Use rather displayText() that does the same.

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

Parameters
I: Image associated to the display.
i,j: Upper left image point location of the string in the display.
string: String to display in overlay.
color: String color.
See also
setFont(), displayText()

Definition at line 813 of file vpDisplay.cpp.

References vpImage< Type >::display, vpDisplay::displayCharString(), vpImagePoint::set_i(), vpImagePoint::set_j(), and vpERROR_TRACE.

void vpDisplay::displayCharString ( const vpImage< vpRGBa > &  I,
const vpImagePoint ip,
const char *  string,
const vpColor color 
)
staticinherited

Display a string at the image point ip location. Use rather displayText() that does the same.

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

Parameters
I: Image associated to the display.
ip: Upper left image point location of the string in the display.
string: String to display in overlay.
color: String color.
See also
setFont(), displayText()

Definition at line 779 of file vpDisplay.cpp.

References vpImage< Type >::display, vpDisplay::displayCharString(), and vpERROR_TRACE.

void vpDisplay::displayCharString ( const vpImage< vpRGBa > &  I,
int  i,
int  j,
const char *  string,
const vpColor color 
)
staticinherited

Display a string at the image point (i,j) location. Use rather displayText() that does the same.

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

Parameters
I: Image associated to the display.
i,j: Upper left image point location of the string in the display.
string: String to display in overlay.
color: String color.
See also
setFont(), displayText()

Definition at line 851 of file vpDisplay.cpp.

References vpImage< Type >::display, vpDisplay::displayCharString(), vpImagePoint::set_i(), vpImagePoint::set_j(), and vpERROR_TRACE.

void vpDisplayOpenCV::displayCircle ( const vpImagePoint center,
unsigned int  radius,
const vpColor color,
bool  fill = false,
unsigned int  thickness = 1 
)
protectedvirtual

Display a circle.

Parameters
center: Circle center position.
radius: Circle radius.
color: Circle color.
fill: When set to true fill the circle.
thickness: Thickness of the circle. This parameter is only useful when fill is set to false.

Implements vpDisplay.

Definition at line 1037 of file vpDisplayOpenCV.cpp.

References vpRGBa::B, vpDisplay::displayHasBeenInitialized, vpRGBa::G, vpImagePoint::get_u(), vpImagePoint::get_v(), vpColor::id, vpColor::id_unknown, vpDisplayException::notInitializedError, vpRGBa::R, vpMath::round(), and vpERROR_TRACE.

void vpDisplay::displayCircle ( const vpImage< unsigned char > &  I,
const vpImagePoint center,
unsigned int  radius,
const vpColor color,
bool  fill = false,
unsigned int  thickness = 1 
)
staticinherited

Display a circle.

Parameters
I: The image associated to the display.
center: Circle center position.
radius: Circle radius.
color: Circle color.
fill: When set to true fill the rectangle.
thickness: Thickness of the circle. This parameter is only useful when fill is set to false.

Definition at line 1022 of file vpDisplay.cpp.

References vpImage< Type >::display, vpDisplay::displayCircle(), and vpERROR_TRACE.

void vpDisplay::displayCircle ( const vpImage< unsigned char > &  I,
int  i,
int  j,
unsigned int  radius,
const vpColor color,
bool  fill = false,
unsigned int  thickness = 1 
)
staticinherited

Display a circle.

Parameters
I: The image associated to the display.
i,j: Circle center position.
radius: Circle radius.
color: Circle color.
fill: When set to true fill the rectangle.
thickness: Thickness of the circle. This parameter is only useful when fill is set to false.

Definition at line 1084 of file vpDisplay.cpp.

References vpImage< Type >::display, vpDisplay::displayCircle(), vpImagePoint::set_i(), vpImagePoint::set_j(), and vpERROR_TRACE.

void vpDisplay::displayCircle ( const vpImage< vpRGBa > &  I,
const vpImagePoint center,
unsigned int  radius,
const vpColor color,
bool  fill = false,
unsigned int  thickness = 1 
)
staticinherited

Display a circle.

Parameters
I: The image associated to the display.
center: Circle center position.
radius: Circle radius.
color: Circle color.
fill: When set to true fill the rectangle.
thickness: Thickness of the circle. This parameter is only useful when fill is set to false.

Definition at line 1052 of file vpDisplay.cpp.

References vpImage< Type >::display, vpDisplay::displayCircle(), and vpERROR_TRACE.

void vpDisplay::displayCircle ( const vpImage< vpRGBa > &  I,
int  i,
int  j,
unsigned int  radius,
const vpColor color,
bool  fill = false,
unsigned int  thickness = 1 
)
staticinherited

Display a circle.

Parameters
I: The image associated to the display.
i,j: Circle center position.
radius: Circle radius.
color: Circle color.
fill: When set to true fill the rectangle.
thickness: Thickness of the circle. This parameter is only useful when fill is set to false.

Definition at line 1122 of file vpDisplay.cpp.

References vpImage< Type >::display, vpDisplay::displayCircle(), vpImagePoint::set_i(), vpImagePoint::set_j(), and vpERROR_TRACE.

void vpDisplayOpenCV::displayCross ( const vpImagePoint ip,
unsigned int  size,
const vpColor color,
unsigned int  thickness = 1 
)
protectedvirtual

Display a cross at the image point ip location.

Parameters
ip: Cross location.
size: Size (width and height) of the cross.
color: Cross color.
thickness: Thickness of the lines used to display the cross.

Implements vpDisplay.

Definition at line 1125 of file vpDisplayOpenCV.cpp.

References vpDisplay::displayHasBeenInitialized, displayLine(), vpImagePoint::get_i(), vpImagePoint::get_j(), vpDisplayException::notInitializedError, vpImagePoint::set_i(), vpImagePoint::set_j(), and vpERROR_TRACE.

void vpDisplay::displayCross ( const vpImage< unsigned char > &  I,
const vpImagePoint ip,
unsigned int  size,
const vpColor color,
unsigned int  thickness = 1 
)
staticinherited

Display a cross at the image point ip location.

Parameters
I: The image associated to the display.
ip: Cross location.
size: Size (width and height) of the cross.
color: Cross color.
thickness: Thickness of the lines used to display the cross.

Definition at line 1153 of file vpDisplay.cpp.

References vpImage< Type >::display, vpDisplay::displayCross(), and vpERROR_TRACE.

void vpDisplay::displayCross ( const vpImage< unsigned char > &  I,
int  i,
int  j,
unsigned int  size,
const vpColor color,
unsigned int  thickness = 1 
)
staticinherited

Display a cross at the image point (i,j) location.

Parameters
I: The image associated to the display.
i,j: Cross location.
size: Size (width and height) of the cross.
color: Cross color.
thickness: Thickness of the lines used to display the cross.

Definition at line 1206 of file vpDisplay.cpp.

References vpImage< Type >::display, vpDisplay::displayCross(), vpImagePoint::set_i(), vpImagePoint::set_j(), and vpERROR_TRACE.

void vpDisplay::displayCross ( const vpImage< vpRGBa > &  I,
const vpImagePoint ip,
unsigned int  size,
const vpColor color,
unsigned int  thickness = 1 
)
staticinherited

Display a cross at the image point ip location.

Parameters
I: The image associated to the display.
ip: Cross location.
size: Size (width and height) of the cross.
color: Cross color.
thickness: Thickness of the lines used to display the cross.

Definition at line 1180 of file vpDisplay.cpp.

References vpImage< Type >::display, vpDisplay::displayCross(), and vpERROR_TRACE.

void vpDisplay::displayCross ( const vpImage< vpRGBa > &  I,
int  i,
int  j,
unsigned int  size,
const vpColor color,
unsigned int  thickness = 1 
)
staticinherited

Display a cross at the image point (i,j) location.

Parameters
I: The image associated to the display.
i,j: Cross location.
size: Size (width and height) of the cross.
color: Cross color.
thickness: Thickness of the lines used to display the cross.

Definition at line 1237 of file vpDisplay.cpp.

References vpImage< Type >::display, vpDisplay::displayCross(), vpImagePoint::set_i(), vpImagePoint::set_j(), and vpERROR_TRACE.

void vpDisplayOpenCV::displayDotLine ( const vpImagePoint ip1,
const vpImagePoint ip2,
const vpColor color,
unsigned int  thickness = 1 
)
protectedvirtual

Display a dashed line from image point ip1 to image point ip2.

Warning
Dot lines are not yet implemented in OpenCV. We display a normal line instead.
Parameters
ip1,ip2: Initial and final image points.
color: Line color.
thickness: Line thickness.

Implements vpDisplay.

Definition at line 1172 of file vpDisplayOpenCV.cpp.

References vpRGBa::B, vpDisplay::displayHasBeenInitialized, vpRGBa::G, vpImagePoint::get_u(), vpImagePoint::get_v(), vpColor::id, vpColor::id_unknown, vpDisplayException::notInitializedError, vpRGBa::R, vpMath::round(), and vpERROR_TRACE.

void vpDisplay::displayDotLine ( const vpImage< unsigned char > &  I,
const vpImagePoint ip1,
const vpImagePoint ip2,
const vpColor color,
unsigned int  thickness = 1 
)
staticinherited

Display a dashed line from image point ip1 to image point ip2.

Parameters
I: The image associated to the display.
ip1,ip2: Initial and final image points.
color: Line color.
thickness: Dashed line thickness.

Definition at line 1266 of file vpDisplay.cpp.

References vpImage< Type >::display, vpDisplay::displayDotLine(), and vpERROR_TRACE.

void vpDisplay::displayDotLine ( const vpImage< unsigned char > &  I,
int  i1,
int  j1,
int  i2,
int  j2,
const vpColor color,
unsigned int  thickness = 1 
)
staticinherited

Display a dashed line from image point (i1,j1) to image point (i2,j2).

Parameters
I: The image associated to the display.
i1,j1Initial image point.
i2,j2Final image point.
color: Line color.
thickness: Dashed line thickness.

Definition at line 1321 of file vpDisplay.cpp.

References vpImage< Type >::display, vpDisplay::displayDotLine(), vpImagePoint::set_i(), vpImagePoint::set_j(), and vpERROR_TRACE.

void vpDisplay::displayDotLine ( const vpImage< vpRGBa > &  I,
const vpImagePoint ip1,
const vpImagePoint ip2,
const vpColor color,
unsigned int  thickness = 1 
)
staticinherited

Display a dashed line from image point ip1 to image point ip2.

Parameters
I: The image associated to the display.
ip1,ip2: Initial and final image points.
color: Line color.
thickness: Dashed line thickness.

Definition at line 1293 of file vpDisplay.cpp.

References vpImage< Type >::display, vpDisplay::displayDotLine(), and vpERROR_TRACE.

void vpDisplay::displayDotLine ( const vpImage< vpRGBa > &  I,
int  i1,
int  j1,
int  i2,
int  j2,
const vpColor color,
unsigned int  thickness = 1 
)
staticinherited

Display a dashed line from image point (i1,j1) to image point (i2,j2).

Parameters
I: The image associated to the display.
i1,j1Initial image point.
i2,j2Final image point.
color: Line color.
thickness: Dashed line thickness.

Definition at line 1353 of file vpDisplay.cpp.

References vpImage< Type >::display, vpDisplay::displayDotLine(), vpImagePoint::set_i(), vpImagePoint::set_j(), and vpERROR_TRACE.

void vpDisplay::displayEllipse ( const vpImage< unsigned char > &  I,
const vpImagePoint center,
const double &  coef1,
const double &  coef2,
const double &  coef3,
bool  use_centered_moments,
const vpColor color,
unsigned int  thickness = 1 
)
staticinherited

Display an ellipse from its parameters expressed in pixels.

Parameters
I: Image to consider.
center: Center $(u_c, v_c)$ of the ellipse.
coef1,coef2,coef3: Depending on the parameter use_centered_moments these parameters are:
  • the centered moments expressed in pixels: $\mu_{20}, \mu_{11}, \mu_{02}$;
  • the major and minor axis lenght in pixels and the excentricity of the ellipse in radians: $a, b, e$.
use_centered_moments: When false, the parameters coef1, coef2, coef3 are the parameters $a, b, e$. When true, the parameters coef1, coef2, coef3 are rather the centered moments $\mu_{20}, \mu_{11}, \mu_{02}$ expressed in pixels. In that case, we compute the parameters a, b and e from the centered moments.
color: Drawings color.
thickness: Drawings thickness.

All the points $(u_\theta,v_\theta)$ on the ellipse are drawn thanks to its parametric representation:

\[ \left(\begin{array}{c} u_\theta \\ v_\theta \end{array} \right) = \left(\begin{array}{c} u_c \\ v_c \end{array} \right) + \left(\begin{array}{cc} \cos(e) & -\sin(e) \\ \sin(e) & \cos(e) \end{array} \right) \left(\begin{array}{c} a \cos(\theta) \\ b \sin(\theta) \end{array} \right) \]

with $0 \leq \theta \leq 2\pi$.

The following example shows how to use for example this function to display the result of a tracking.

vpMeEllipse ellipse;
...
vpDisplay::display(I);
ellipse.track(I) ;
vpDisplay::displayEllipse(I, ellipse.getCenter(), ellipse.get_mu20(), ellipse.get_mu11(), ellipse.get_mu02(),
true, vpColor::orange, 1);

Definition at line 3608 of file vpDisplay.cpp.

References vpMath::rad().

Referenced by vpMbtDistanceCircle::display(), and vpDisplay::displayEllipse().

void vpDisplay::displayEllipse ( const vpImage< unsigned char > &  I,
const vpImagePoint center,
const double &  coef1,
const double &  coef2,
const double &  coef3,
const double &  theta1,
const double &  theta2,
bool  use_centered_moments,
const vpColor color,
unsigned int  thickness = 1 
)
staticinherited

Display an ellipse from its parameters expressed in pixels.

Parameters
I: Image to consider.
center: Center $(u_c, v_c)$ of the ellipse.
coef1,coef2,coef3: Depending on the parameter use_centered_moments these parameters are:
  • the centered moments expressed in pixels: $\mu_{20}, \mu_{11}, \mu_{02}$;
  • the major and minor axis lenght in pixels and the excentricity of the ellipse in radians: $a, b, e$.
theta1,theta2: Angles $(\theta_1, \theta_2)$ in radians used to select a portion of the ellipse. If theta1=0 and theta2=vpMath::rad(360) all the ellipse is displayed.
use_centered_moments: When false, the parameters coef1, coef2, coef3 are the parameters $a, b, e$. When true, the parameters coef1, coef2, coef3 are rather the centered moments $\mu_{20}, \mu_{11}, \mu_{02}$ expressed in pixels. In that case, we compute the parameters a, b and e from the centered moments.
color: Drawings color.
thickness: Drawings thickness.

All the points $(u_\theta,v_\theta)$ on the ellipse are drawn thanks to its parametric representation:

\[ \left(\begin{array}{c} u_\theta \\ v_\theta \end{array} \right) = \left(\begin{array}{c} u_c \\ v_c \end{array} \right) + \left(\begin{array}{cc} \cos(e) & -\sin(e) \\ \sin(e) & \cos(e) \end{array} \right) \left(\begin{array}{c} a \cos(\theta) \\ b \sin(\theta) \end{array} \right) \]

with $\theta_1 \leq \theta \leq \theta_2$.

The following example shows how to use for example this function to display the result of a tracking.

vpMeEllipse ellipse;
...
vpDisplay::display(I);
ellipse.track(I) ;
ellipse.get_mu11(), ellipse.get_mu02(),
ellipse.getSmallestAngle(), ellipse.getHighestAngle(),
true, vpColor::orange, 1);

Definition at line 3866 of file vpDisplay.cpp.

References vpImage< Type >::display, vpDisplay::displayLine(), vpImagePoint::get_i(), vpImagePoint::get_j(), vpImagePoint::set_i(), vpImagePoint::set_j(), and vpMath::sqr().

void vpDisplay::displayEllipse ( const vpImage< vpRGBa > &  I,
const vpImagePoint center,
const double &  coef1,
const double &  coef2,
const double &  coef3,
bool  use_centered_moments,
const vpColor color,
unsigned int  thickness = 1 
)
staticinherited

Display an ellipse from its parameters expressed in pixels.

Parameters
I: Image to consider.
center: Center $(u_c, v_c)$ of the ellipse.
coef1,coef2,coef3: Depending on the parameter use_centered_moments these parameters are:
  • the centered moments expressed in pixels: $\mu_{20}, \mu_{11}, \mu_{02}$;
  • the major and minor axis lenght in pixels and the excentricity of the ellipse in radians: $a, b, e$.
use_centered_moments: When false, the parameters coef1, coef2, coef3 are the parameters $a, b, e$. When true, the parameters coef1, coef2, coef3 are rather the centered moments $\mu_{20}, \mu_{11}, \mu_{02}$ expressed in pixels. In that case, we compute the parameters a, b and e from the centered moments.
color: Drawings color.
thickness: Drawings thickness.

All the points $(u_\theta,v_\theta)$ on the ellipse are drawn thanks to its parametric representation:

\[ \left(\begin{array}{c} u_\theta \\ v_\theta \end{array} \right) = \left(\begin{array}{c} u_c \\ v_c \end{array} \right) + \left(\begin{array}{cc} \cos(e) & -\sin(e) \\ \sin(e) & \cos(e) \end{array} \right) \left(\begin{array}{c} a \cos(\theta) \\ b \sin(\theta) \end{array} \right) \]

with $0 \leq \theta \leq 2\pi$.

The following example shows how to use for example this function to display the result of a tracking.

vpMeEllipse ellipse;
...
vpDisplay::display(I);
ellipse.track(I) ;
vpDisplay::displayEllipse(I, ellipse.getCenter(), ellipse.get_mu20(), ellipse.get_mu11(), ellipse.get_mu02(),
true, vpColor::orange, 1);

Definition at line 3807 of file vpDisplay.cpp.

References vpDisplay::displayEllipse(), and vpMath::rad().

void vpDisplay::displayEllipse ( const vpImage< vpRGBa > &  I,
const vpImagePoint center,
const double &  coef1,
const double &  coef2,
const double &  coef3,
const double &  theta1,
const double &  theta2,
bool  use_centered_moments,
const vpColor color,
unsigned int  thickness = 1 
)
staticinherited

Display an ellipse from its parameters expressed in pixels.

Parameters
I: Image to consider.
center: Center $(u_c, v_c)$ of the ellipse.
coef1,coef2,coef3: Depending on the parameter use_centered_moments these parameters are:
  • the centered moments expressed in pixels: $\mu_{20}, \mu_{11}, \mu_{02}$;
  • the major and minor axis lenght in pixels and the excentricity of the ellipse in radians: $a, b, e$.
theta1,theta2: Angles $(\theta_1, \theta_2)$ in radians used to select a portion of the ellipse. If theta1=0 and theta2=vpMath::rad(360) all the ellipse is displayed.
use_centered_moments: When false, the parameters coef1, coef2, coef3 are the parameters $a, b, e$. When true, the parameters coef1, coef2, coef3 are rather the centered moments $\mu_{20}, \mu_{11}, \mu_{02}$ expressed in pixels. In that case, we compute the parameters a, b and e from the centered moments.
color: Drawings color.
thickness: Drawings thickness.

All the points $(u_\theta,v_\theta)$ on the ellipse are drawn thanks to its parametric representation:

\[ \left(\begin{array}{c} u_\theta \\ v_\theta \end{array} \right) = \left(\begin{array}{c} u_c \\ v_c \end{array} \right) + \left(\begin{array}{cc} \cos(e) & -\sin(e) \\ \sin(e) & \cos(e) \end{array} \right) \left(\begin{array}{c} a \cos(\theta) \\ b \sin(\theta) \end{array} \right) \]

with $\theta_1 \leq \theta \leq \theta_2$.

The following example shows how to use for example this function to display the result of a tracking.

vpMeEllipse ellipse;
...
vpDisplay::display(I);
ellipse.track(I) ;
ellipse.get_mu11(), ellipse.get_mu02(),
ellipse.getSmallestAngle(), ellipse.getHighestAngle(),
true, vpColor::orange, 1);

Definition at line 3667 of file vpDisplay.cpp.

References vpImage< Type >::display, vpDisplay::displayLine(), vpImagePoint::get_i(), vpImagePoint::get_j(), vpImagePoint::set_i(), vpImagePoint::set_j(), and vpMath::sqr().

void vpDisplay::displayFrame ( const vpImage< unsigned char > &  I,
const vpHomogeneousMatrix cMo,
const vpCameraParameters cam,
double  size,
const vpColor color = vpColor::none,
unsigned int  thickness = 1 
)
staticinherited

Display the projection of an object frame represented by 3 arrows in the image.

Parameters
I: The image associated to the display.
cMo: Homogeneous matrix that gives the transformation between the camera frame and the object frame to project in the image.
cam: Camera intrinsic parameters.
size: Size of the object frame.
color: Color used to display the frame in the image.
thickness: the thickness of the line
Examples:
mbtEdgeKltTracking.cpp, mbtEdgeTracking.cpp, mbtKltTracking.cpp, servoSimu4Points.cpp, servoSimuCylinder.cpp, servoSimuSphere.cpp, tutorial-detection-object-mbt.cpp, tutorial-mb-edge-tracker.cpp, tutorial-mb-hybrid-tracker.cpp, tutorial-mb-klt-tracker.cpp, tutorial-pose-from-points-image.cpp, and tutorial-pose-from-points-tracking.cpp.

Definition at line 375 of file vpDisplay.cpp.

References vpColor::blue, vpMeterPixelConversion::convertPoint(), vpDisplay::displayArrow(), vpColor::green, vpColor::none, vpTracker::p, vpColor::red, vpPoint::setWorldCoordinates(), and vpForwardProjection::track().

Referenced by vpPose::display(), vpMbTracker::initClick(), vpSimulatorAfma6::updateArticularPosition(), and vpSimulatorViper850::updateArticularPosition().

void vpDisplay::displayFrame ( const vpImage< vpRGBa > &  I,
const vpHomogeneousMatrix cMo,
const vpCameraParameters cam,
double  size,
const vpColor color = vpColor::none,
unsigned int  thickness = 1 
)
staticinherited

Display the projection of an object frame represented by 3 arrows in the image.

Parameters
I: The image associated to the display.
cMo: Homogeneous matrix that gives the transformation between the camera frame and the object frame to project in the image.
cam: Camera intrinsic parameters.
size: Size of the object frame.
color: Color used to display the frame in the image.
thickness: the thickness of the line

Definition at line 445 of file vpDisplay.cpp.

References vpColor::blue, vpMeterPixelConversion::convertPoint(), vpDisplay::displayArrow(), vpColor::green, vpColor::none, vpTracker::p, vpColor::red, vpPoint::setWorldCoordinates(), and vpForwardProjection::track().

void vpDisplayOpenCV::displayImage ( const vpImage< vpRGBa > &  I)
protectedvirtual

Display the color image I in RGBa format (32bits).

Warning
Display has to be initialized.
suppres the overlay drawing
Parameters
I: Image to display.
See also
init(), closeDisplay()

Implements vpDisplay.

Definition at line 670 of file vpDisplayOpenCV.cpp.

References vpImageConvert::convert(), vpDisplay::displayHasBeenInitialized, vpImage< Type >::getHeight(), vpImage< Type >::getWidth(), vpDisplay::height, vpDisplayException::notInitializedError, vpERROR_TRACE, and vpDisplay::width.

void vpDisplayOpenCV::displayImage ( const vpImage< unsigned char > &  I)
protectedvirtual

Display the gray level image I (8bits).

Warning
Display has to be initialized.
suppres the overlay drawing
Parameters
I: Image to display.
See also
init(), closeDisplay()

Implements vpDisplay.

Definition at line 531 of file vpDisplayOpenCV.cpp.

References vpImageConvert::convert(), vpDisplay::displayHasBeenInitialized, vpImage< Type >::getHeight(), vpImage< Type >::getWidth(), vpDisplay::height, vpDisplayException::notInitializedError, vpERROR_TRACE, and vpDisplay::width.

void vpDisplayOpenCV::displayImage ( const unsigned char *  I)
protected
Warning
ot implemented yet
See also
init(), closeDisplay()

Definition at line 802 of file vpDisplayOpenCV.cpp.

References vpTRACE.

void vpDisplayOpenCV::displayImageROI ( const vpImage< unsigned char > &  I,
const vpImagePoint iP,
const unsigned int  w,
const unsigned int  h 
)
protectedvirtual

Display a selection of the gray level image I (8bits).

Warning
Display has to be initialized.
Suppress the overlay drawing in the region of interest.
Parameters
I: Image to display.
iP: Top left corner of the region of interest
w,h: Width and height of the region of interest
See also
init(), closeDisplay()

Implements vpDisplay.

Definition at line 566 of file vpDisplayOpenCV.cpp.

References vpImageConvert::convert(), vpImageTools::createSubImage(), vpDisplay::displayHasBeenInitialized, vpImagePoint::get_i(), vpImagePoint::get_j(), vpImage< Type >::getHeight(), vpImage< Type >::getWidth(), vpDisplay::height, vpDisplayException::notInitializedError, vpERROR_TRACE, and vpDisplay::width.

void vpDisplayOpenCV::displayImageROI ( const vpImage< vpRGBa > &  I,
const vpImagePoint iP,
const unsigned int  w,
const unsigned int  h 
)
protectedvirtual

Display a selection of the color image I in RGBa format (32bits).

Warning
Display has to be initialized.
Suppress the overlay drawing in the region of interest.
Parameters
I: Image to display.
iP: Top left corner of the region of interest
w,h: Width and height of the region of interest
See also
init(), closeDisplay()

Implements vpDisplay.

Definition at line 705 of file vpDisplayOpenCV.cpp.

References vpImageConvert::convert(), vpImageTools::createSubImage(), vpDisplay::displayHasBeenInitialized, vpImagePoint::get_i(), vpImagePoint::get_j(), vpImage< Type >::getHeight(), vpImage< Type >::getWidth(), vpDisplay::height, vpDisplayException::notInitializedError, vpERROR_TRACE, and vpDisplay::width.

void vpDisplayOpenCV::displayLine ( const vpImagePoint ip1,
const vpImagePoint ip2,
const vpColor color,
unsigned int  thickness = 1 
)
protectedvirtual

Display a line from image point ip1 to image point ip2.

Parameters
ip1,ip2: Initial and final image points.
color: Line color.
thickness: Line thickness.

Implements vpDisplay.

Definition at line 1233 of file vpDisplayOpenCV.cpp.

References vpRGBa::B, vpDisplay::displayHasBeenInitialized, vpRGBa::G, vpImagePoint::get_u(), vpImagePoint::get_v(), vpColor::id, vpColor::id_unknown, vpDisplayException::notInitializedError, vpRGBa::R, vpMath::round(), and vpERROR_TRACE.

Referenced by displayArrow(), displayCross(), and displayPoint().

void vpDisplay::displayLine ( const vpImage< unsigned char > &  I,
const vpImagePoint ip1,
const vpImagePoint ip2,
const vpColor color,
unsigned int  thickness = 1 
)
staticinherited

Display a line from image point ip1 to image point ip2.

Parameters
I: The image associated to the display.
ip1,ip2: Initial and final image points.
color: Line color.
thickness: Line thickness.

Definition at line 1385 of file vpDisplay.cpp.

References vpImage< Type >::display, vpDisplay::displayLine(), and vpERROR_TRACE.

void vpDisplay::displayLine ( const vpImage< unsigned char > &  I,
int  i1,
int  j1,
int  i2,
int  j2,
const vpColor color,
unsigned int  thickness = 1 
)
staticinherited

Display a line from image point (i1,j1) to image point (i2,j2).

Parameters
I: The image associated to the display.
i1,j1Initial image point.
i2,j2Final image point.
color: Line color.
thickness: Line thickness.

Definition at line 1415 of file vpDisplay.cpp.

References vpImage< Type >::display, vpDisplay::displayLine(), vpImagePoint::set_i(), vpImagePoint::set_j(), and vpERROR_TRACE.

void vpDisplay::displayLine ( const vpImage< vpRGBa > &  I,
const vpImagePoint ip1,
const vpImagePoint ip2,
const vpColor color,
unsigned int  thickness = 1 
)
staticinherited

Display a line from image point ip1 to image point ip2.

Parameters
I: The image associated to the display.
ip1,ip2: Initial and final image points.
color: Line color.
thickness: Line thickness.

Definition at line 1483 of file vpDisplay.cpp.

References vpImage< Type >::display, vpDisplay::displayLine(), and vpERROR_TRACE.

void vpDisplay::displayLine ( const vpImage< vpRGBa > &  I,
int  i1,
int  j1,
int  i2,
int  j2,
const vpColor color,
unsigned int  thickness = 1 
)
staticinherited

Display a line from image point (i1,j1) to image point (i2,j2).

Parameters
I: The image associated to the display.
i1,j1Initial image point.
i2,j2Final image point.
color: Line color.
thickness: Line thickness.

Definition at line 1450 of file vpDisplay.cpp.

References vpImage< Type >::display, vpDisplay::displayLine(), vpImagePoint::set_i(), vpImagePoint::set_j(), and vpERROR_TRACE.

void vpDisplayOpenCV::displayPoint ( const vpImagePoint ip,
const vpColor color 
)
protectedvirtual

Display a point at the image point ip location.

Parameters
ip: Point location.
color: Point color.

Implements vpDisplay.

Definition at line 1289 of file vpDisplayOpenCV.cpp.

References vpDisplay::displayHasBeenInitialized, displayLine(), vpDisplayException::notInitializedError, and vpERROR_TRACE.

void vpDisplay::displayPoint ( const vpImage< unsigned char > &  I,
const vpImagePoint ip,
const vpColor color,
unsigned int  thickness = 1 
)
staticinherited

Display a point at the image point ip location.

Parameters
I: The image associated to the display.
ip: Point location.
color: Point color.
thickness: Thickness of the point

Definition at line 1511 of file vpDisplay.cpp.

References vpImage< Type >::display, vpDisplay::displayPoint(), vpDisplay::displayRectangle(), vpRect::moveCenter(), and vpERROR_TRACE.

void vpDisplay::displayPoint ( const vpImage< unsigned char > &  I,
int  i,
int  j,
const vpColor color,
unsigned int  thickness = 1 
)
staticinherited

Display a point at the image point (i,j) location.

Parameters
I: The image associated to the display.
i,j: Point location.
color: Point color.
thickness: Thickness of the point

Definition at line 1574 of file vpDisplay.cpp.

References vpImage< Type >::display, vpDisplay::displayPoint(), vpDisplay::displayRectangle(), vpRect::moveCenter(), vpImagePoint::set_i(), vpImagePoint::set_j(), and vpERROR_TRACE.

void vpDisplay::displayPoint ( const vpImage< vpRGBa > &  I,
const vpImagePoint ip,
const vpColor color,
unsigned int  thickness = 1 
)
staticinherited

Display a point at the image point ip location.

Parameters
I: The image associated to the display.
ip: Point location.
color: Point color.
thickness: Thickness of the point

Definition at line 1542 of file vpDisplay.cpp.

References vpImage< Type >::display, vpDisplay::displayPoint(), vpDisplay::displayRectangle(), vpRect::moveCenter(), and vpERROR_TRACE.

void vpDisplay::displayPoint ( const vpImage< vpRGBa > &  I,
int  i,
int  j,
const vpColor color,
unsigned int  thickness = 1 
)
staticinherited

Display a point at the image point (i,j) location.

Parameters
I: The image associated to the display.
i,j: Point location.
color: Point color.
thickness: Thickness of the point

Definition at line 1611 of file vpDisplay.cpp.

References vpImage< Type >::display, vpDisplay::displayPoint(), vpDisplay::displayRectangle(), vpRect::moveCenter(), vpImagePoint::set_i(), vpImagePoint::set_j(), and vpERROR_TRACE.

void vpDisplay::displayPolygon ( const vpImage< unsigned char > &  I,
const std::vector< vpImagePoint > &  vip,
const vpColor color,
unsigned int  thickness = 1 
)
staticinherited

Display a polygon defined by a vector of image points.

Parameters
I: The image associated to the display.
vip: Vector of image point that define the vertexes of the polygon.
color: Line color.
thickness: Line thickness.

Definition at line 1648 of file vpDisplay.cpp.

References vpImage< Type >::display, and vpERROR_TRACE.

void vpDisplay::displayPolygon ( const vpImage< vpRGBa > &  I,
const std::vector< vpImagePoint > &  vip,
const vpColor color,
unsigned int  thickness = 1 
)
staticinherited

Display a polygon defined by a vector of image points.

Parameters
I: The image associated to the display.
vip: Vector of image point that define the vertexes of the polygon.
color: Line color.
thickness: Line thickness.

Definition at line 1677 of file vpDisplay.cpp.

References vpImage< Type >::display, and vpERROR_TRACE.

void vpDisplayOpenCV::displayRectangle ( const vpImagePoint topLeft,
unsigned int  w,
unsigned int  h,
const vpColor color,
bool  fill = false,
unsigned int  thickness = 1 
)
protectedvirtual

Display a rectangle with topLeft as the top-left corner and width and height the rectangle size.

Parameters
topLeft: Top-left corner of the rectangle.
w,h: Rectangle size in terms of width and height.
color: Rectangle color.
fill: When set to true fill the rectangle.
thickness: Thickness of the four lines used to display the rectangle. This parameter is only useful when fill is set to false.

Implements vpDisplay.

Definition at line 1346 of file vpDisplayOpenCV.cpp.

References vpRGBa::B, vpDisplay::displayHasBeenInitialized, vpRGBa::G, vpImagePoint::get_u(), vpImagePoint::get_v(), vpColor::id, vpColor::id_unknown, vpDisplayException::notInitializedError, vpRGBa::R, vpMath::round(), and vpERROR_TRACE.

void vpDisplayOpenCV::displayRectangle ( const vpImagePoint topLeft,
const vpImagePoint bottomRight,
const vpColor color,
bool  fill = false,
unsigned int  thickness = 1 
)
protectedvirtual

Display a rectangle.

Parameters
topLeft: Top-left corner of the rectangle.
bottomRight: Bottom-right corner of the rectangle.
color: Rectangle color.
fill: When set to true fill the rectangle.
thickness: Thickness of the four lines used to display the rectangle. This parameter is only useful when fill is set to false.

Implements vpDisplay.

Definition at line 1453 of file vpDisplayOpenCV.cpp.

References vpRGBa::B, vpDisplay::displayHasBeenInitialized, vpRGBa::G, vpImagePoint::get_u(), vpImagePoint::get_v(), vpColor::id, vpColor::id_unknown, vpDisplayException::notInitializedError, vpRGBa::R, vpMath::round(), and vpERROR_TRACE.

void vpDisplayOpenCV::displayRectangle ( const vpRect rectangle,
const vpColor color,
bool  fill = false,
unsigned int  thickness = 1 
)
protectedvirtual

Display a rectangle.

Parameters
rectangle: Rectangle characteristics.
color: Rectangle color.
fill: When set to true fill the rectangle.
thickness: Thickness of the four lines used to display the rectangle. This parameter is only useful when fill is set to false.

Implements vpDisplay.

Definition at line 1561 of file vpDisplayOpenCV.cpp.

References vpRGBa::B, vpDisplay::displayHasBeenInitialized, vpRGBa::G, vpRect::getBottom(), vpRect::getLeft(), vpRect::getRight(), vpRect::getTop(), vpColor::id, vpColor::id_unknown, vpDisplayException::notInitializedError, vpRGBa::R, vpMath::round(), and vpERROR_TRACE.

void vpDisplay::displayRectangle ( const vpImage< unsigned char > &  I,
const vpImagePoint topLeft,
unsigned int  width,
unsigned int  height,
const vpColor color,
bool  fill = false,
unsigned int  thickness = 1 
)
staticinherited

Display a rectangle with topLeft as the top-left corner and width and height the rectangle size.

Parameters
I: The image associated to the display.
topLeft: Top-left corner of the rectangle.
width,height: Rectangle size.
color: Rectangle color.
fill: When set to true fill the rectangle.
thickness: Thickness of the four lines used to display the rectangle. This parameter is only useful when fill is set to false.

Definition at line 1712 of file vpDisplay.cpp.

References vpImage< Type >::display, vpDisplay::displayRectangle(), and vpERROR_TRACE.

void vpDisplay::displayRectangle ( const vpImage< unsigned char > &  I,
const vpImagePoint topLeft,
const vpImagePoint bottomRight,
const vpColor color,
bool  fill = false,
unsigned int  thickness = 1 
)
staticinherited

Display a rectangle with topLeft as the top-left corner and width and height the rectangle size.

Parameters
I: The image associated to the display.
topLeft: Top-left corner of the rectangle.
bottomRight: Bottom-right corner of the rectangle.
color: Rectangle color.
fill: When set to true fill the rectangle.
thickness: Thickness of the four lines used to display the rectangle. This parameter is only useful when fill is set to false.

Definition at line 1749 of file vpDisplay.cpp.

References vpImage< Type >::display, vpDisplay::displayRectangle(), and vpERROR_TRACE.

void vpDisplay::displayRectangle ( const vpImage< unsigned char > &  I,
const vpRect rectangle,
const vpColor color,
bool  fill = false,
unsigned int  thickness = 1 
)
staticinherited

Display a rectangle with topLeft as the top-left corner and width and height the rectangle size.

Parameters
I: The image associated to the display.
rectangle: Rectangle characteristics.
color: Rectangle color.
fill: When set to true fill the rectangle.
thickness: Thickness of the four lines used to display the rectangle. This parameter is only useful when fill is set to false.

Definition at line 1784 of file vpDisplay.cpp.

References vpImage< Type >::display, vpDisplay::displayRectangle(), and vpERROR_TRACE.

void vpDisplay::displayRectangle ( const vpImage< unsigned char > &  I,
const vpImagePoint center,
float  angle,
unsigned int  width,
unsigned int  height,
const vpColor color,
unsigned int  thickness = 1 
)
staticinherited

Display a rectangle defined by its center, its orientation (angle) and its size.

Parameters
I: Image associated to the display.
center: Rectangle center point.
angle: Angle in radians width an horizontal axis oriented from left to right.
width,height: Rectangle size.
color: Rectangle color.
thickness: Thickness of the four lines used to display the rectangle.

Definition at line 1820 of file vpDisplay.cpp.

References vpImage< Type >::display, vpDisplay::displayLine(), vpImagePoint::get_i(), vpImagePoint::get_j(), vpImagePoint::set_u(), vpImagePoint::set_v(), and vpERROR_TRACE.

void vpDisplay::displayRectangle ( const vpImage< unsigned char > &  I,
int  i,
int  j,
unsigned int  width,
unsigned int  height,
const vpColor color,
bool  fill = false,
unsigned int  thickness = 1 
)
staticinherited

Display a rectangle with (i,j) as the top-left corner and width and height the rectangle size.

Parameters
I: The image associated to the display.
i,j: Top-left corner of the rectangle.
width,height: Rectangle size.
color: Rectangle color.
fill: When set to true fill the rectangle.
thickness: Thickness of the four lines used to display the rectangle. This parameter is only useful when fill is set to false.

Definition at line 2038 of file vpDisplay.cpp.

References vpImage< Type >::display, vpDisplay::displayRectangle(), vpImagePoint::set_i(), vpImagePoint::set_j(), and vpERROR_TRACE.

void vpDisplay::displayRectangle ( const vpImage< unsigned char > &  I,
unsigned int  i,
unsigned int  j,
float  angle,
unsigned int  width,
unsigned int  height,
const vpColor color,
unsigned int  thickness = 1 
)
staticinherited

Display a rectangle defined by its center, its orientation (angle) and its size.

Parameters
I: Image associated to the display.
i,j: Rectangle center point.
angle: Angle in radians width an horizontal axis oriented from left to right.
width,height: Rectangle size.
color: Rectangle color.
thickness: Thickness of the four lines used to display the rectangle.

Definition at line 2078 of file vpDisplay.cpp.

References vpImage< Type >::display, vpDisplay::displayLine(), vpImagePoint::set_u(), vpImagePoint::set_v(), and vpERROR_TRACE.

void vpDisplay::displayRectangle ( const vpImage< vpRGBa > &  I,
const vpImagePoint topLeft,
unsigned int  width,
unsigned int  height,
const vpColor color,
bool  fill = false,
unsigned int  thickness = 1 
)
staticinherited

Display a rectangle with topLeft as the top-left corner and width and height the rectangle size.

Parameters
I: The image associated to the display.
topLeft: Top-left corner of the rectangle.
width,height: Rectangle size.
color: Rectangle color.
fill: When set to true fill the rectangle.
thickness: Thickness of the four lines used to display the rectangle. This parameter is only useful when fill is set to false.

Definition at line 1875 of file vpDisplay.cpp.

References vpImage< Type >::display, vpDisplay::displayRectangle(), and vpERROR_TRACE.

void vpDisplay::displayRectangle ( const vpImage< vpRGBa > &  I,
const vpImagePoint topLeft,
const vpImagePoint bottomRight,
const vpColor color,
bool  fill = false,
unsigned int  thickness = 1 
)
staticinherited

Display a rectangle with topLeft as the top-left corner and width and height the rectangle size.

Parameters
I: The image associated to the display.
topLeft: Top-left corner of the rectangle.
bottomRight: Bottom-right corner of the rectangle.
color: Rectangle color.
fill: When set to true fill the rectangle.
thickness: Thickness of the four lines used to display the rectangle. This parameter is only useful when fill is set to false.

Definition at line 1910 of file vpDisplay.cpp.

References vpImage< Type >::display, vpDisplay::displayRectangle(), and vpERROR_TRACE.

void vpDisplay::displayRectangle ( const vpImage< vpRGBa > &  I,
const vpRect rectangle,
const vpColor color,
bool  fill = false,
unsigned int  thickness = 1 
)
staticinherited

Display a rectangle with topLeft as the top-left corner and width and height the rectangle size.

Parameters
I: The image associated to the display.
rectangle: Rectangle characteristics.
color: Rectangle color.
fill: When set to true fill the rectangle.
thickness: Thickness of the four lines used to display the rectangle. This parameter is only useful when fill is set to false.

Definition at line 1945 of file vpDisplay.cpp.

References vpImage< Type >::display, vpDisplay::displayRectangle(), and vpERROR_TRACE.

void vpDisplay::displayRectangle ( const vpImage< vpRGBa > &  I,
const vpImagePoint center,
float  angle,
unsigned int  width,
unsigned int  height,
const vpColor color,
unsigned int  thickness = 1 
)
staticinherited

Display a rectangle defined by its center, its orientation (angle) and its size.

Parameters
I: Image associated to the display.
center: Rectangle center point.
angle: Angle in radians width an horizontal axis oriented from left to right.
width,height: Rectangle size.
color: Rectangle color.
thickness: Thickness of the four lines used to display the rectangle.

Definition at line 1981 of file vpDisplay.cpp.

References vpImage< Type >::display, vpDisplay::displayLine(), vpImagePoint::get_i(), vpImagePoint::get_j(), vpImagePoint::set_u(), vpImagePoint::set_v(), and vpERROR_TRACE.

void vpDisplay::displayRectangle ( const vpImage< vpRGBa > &  I,
int  i,
int  j,
unsigned int  width,
unsigned int  height,
const vpColor color,
bool  fill = false,
unsigned int  thickness = 1 
)
staticinherited

Display a rectangle with (i,j) as the top-left corner and width and height the rectangle size.

Parameters
I: The image associated to the display.
i,j: Top-left corner of the rectangle.
width,height: Rectangle size.
color: Rectangle color.
fill: When set to true fill the rectangle.
thickness: Thickness of the four lines used to display the rectangle. This parameter is only useful when fill is set to false.

Definition at line 2130 of file vpDisplay.cpp.

References vpImage< Type >::display, vpDisplay::displayRectangle(), vpImagePoint::set_i(), vpImagePoint::set_j(), and vpERROR_TRACE.

void vpDisplay::displayRectangle ( const vpImage< vpRGBa > &  I,
unsigned int  i,
unsigned int  j,
float  angle,
unsigned int  width,
unsigned int  height,
const vpColor color,
unsigned int  thickness = 1 
)
staticinherited

Display a rectangle defined by its center, its orientation (angle) and its size.

Parameters
I: Image associated to the display.
i,j: Rectangle center point.
angle: Angle in radians width an horizontal axis oriented from left to right.
width,height: Rectangle size.
color: Rectangle color.
thickness: Thickness of the four lines used to display the rectangle.

Definition at line 2169 of file vpDisplay.cpp.

References vpImage< Type >::display, vpDisplay::displayLine(), vpImagePoint::set_u(), vpImagePoint::set_v(), and vpERROR_TRACE.

void vpDisplay::displayText ( const vpImage< unsigned char > &  I,
const vpImagePoint ip,
const std::string &  s,
const vpColor color 
)
staticinherited

Display a string at the image point ip location.

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

Parameters
I: Image associated to the display.
ip: Upper left image point location of the string in the display.
s: String to display in overlay.
color: String color.
See also
setFont()
Examples:
displayD3D.cpp, displayGTK.cpp, displayOpenCV.cpp, displayX.cpp, displayXMulti.cpp, fernClassifier.cpp, manDisplay.cpp, mbtEdgeKltTracking.cpp, mbtEdgeTracking.cpp, mbtKltTracking.cpp, planarObjectDetector.cpp, servoAfma6Points2DCamVelocityEyeToHand.cpp, servoSimuFourPoints2DPolarCamVelocityDisplay.cpp, templateTracker.cpp, testDisplays.cpp, tutorial-barcode-detector-live.cpp, tutorial-barcode-detector.cpp, tutorial-blob-tracker-live-firewire.cpp, tutorial-blob-tracker-live-v4l2.cpp, tutorial-detection-object-mbt.cpp, tutorial-face-detector-live.cpp, tutorial-face-detector.cpp, tutorial-ibvs-4pts-image-tracking.cpp, tutorial-ibvs-4pts-ogre-tracking.cpp, tutorial-ibvs-4pts-wireframe-robot-afma6.cpp, tutorial-ibvs-4pts-wireframe-robot-viper.cpp, tutorial-image-filter.cpp, tutorial-klt-tracker-live-v4l2.cpp, tutorial-klt-tracker.cpp, tutorial-mb-edge-tracker.cpp, tutorial-mb-hybrid-tracker.cpp, tutorial-mb-klt-tracker.cpp, tutorial-simu-pioneer-continuous-gain-adaptive.cpp, tutorial-simu-pioneer-continuous-gain-constant.cpp, tutorial-simu-pioneer-pan.cpp, tutorial-simu-pioneer.cpp, and tutorial-video-recorder.cpp.

Definition at line 887 of file vpDisplay.cpp.

References vpImage< Type >::display, vpDisplay::displayCharString(), and vpERROR_TRACE.

Referenced by vpKltOpencv::display(), vpMbtDistanceKltPoints::displayPrimitive(), and vpMbTracker::initClick().

void vpDisplay::displayText ( const vpImage< unsigned char > &  I,
int  i,
int  j,
const std::string &  s,
const vpColor color 
)
staticinherited

Display a string at the image point (i,j) location.

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

Parameters
I: Image associated to the display.
i,j: Upper left image point location of the string in the display.
s: String to display in overlay.
color: String color.
See also
setFont()

Definition at line 953 of file vpDisplay.cpp.

References vpImage< Type >::display, vpDisplay::displayCharString(), vpImagePoint::set_i(), vpImagePoint::set_j(), and vpERROR_TRACE.

void vpDisplay::displayText ( const vpImage< vpRGBa > &  I,
const vpImagePoint ip,
const std::string &  s,
const vpColor color 
)
staticinherited

Display a string at the image point ip location.

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

Parameters
I: Image associated to the display.
ip: Upper left image point location of the string in the display.
s: String to display in overlay.
color: String color.
See also
setFont()

Definition at line 920 of file vpDisplay.cpp.

References vpImage< Type >::display, vpDisplay::displayCharString(), and vpERROR_TRACE.

void vpDisplay::displayText ( const vpImage< vpRGBa > &  I,
int  i,
int  j,
const std::string &  s,
const vpColor color 
)
staticinherited

Display a string at the image point (i,j) location.

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

Parameters
I: Image associated to the display.
i,j: Upper left image point location of the string in the display.
s: String to display in overlay.
color: String color.
See also
setFont()

Definition at line 990 of file vpDisplay.cpp.

References vpImage< Type >::display, vpDisplay::displayCharString(), vpImagePoint::set_i(), vpImagePoint::set_j(), and vpERROR_TRACE.

void vpDisplay::flush ( const vpImage< unsigned char > &  I)
staticinherited

Flushes the output buffer associated to image I display. It's necessary to use this function to see the results of any drawing.

Warning
This function is particular and must be called to show the overlay. Because it's time spending, use it parcimoniously.
#include <visp/vpDisplay.h>
#include <visp/vpDisplayGDI.h>
#include <visp/vpColor.h>
#include <visp/vpImage.h>
#include <visp/vpImagePoint.h>
int main() {
d.init(I);
vpDisplay::display(I); // display the image
vpImagePoint center;
unsigned int radius = 100;
vpDisplay::flush(I); // Mendatory to display the requested features.
}
Examples:
AROgre.cpp, AROgreBasic.cpp, BSpline.cpp, displayD3D.cpp, displayGTK.cpp, displayOpenCV.cpp, displaySequence.cpp, displayX.cpp, displayXMulti.cpp, fernClassifier.cpp, grab1394CMU.cpp, grab1394Two.cpp, grabDirectShow.cpp, grabDirectShowMulti.cpp, grabDisk.cpp, grabOpenCV-2.cpp, grabV4l2.cpp, imageSequenceReader.cpp, keyPointSurf.cpp, kinectAcquisition.cpp, manDisplay.cpp, manGeometricFeatures.cpp, manServo4PointsDisplay.cpp, manSimu4Dots.cpp, mbtEdgeKltTracking.cpp, mbtEdgeTracking.cpp, mbtKltTracking.cpp, Nurbs.cpp, photometricVisualServoing.cpp, planarObjectDetector.cpp, poseVirtualVS.cpp, servoAfma4Point2DArtVelocity.cpp, servoAfma4Point2DCamVelocity.cpp, servoAfma4Point2DCamVelocityKalman.cpp, servoAfma62DhalfCamVelocity.cpp, servoAfma6Cylinder2DCamVelocity.cpp, servoAfma6Cylinder2DCamVelocitySecondaryTask.cpp, servoAfma6Ellipse2DCamVelocity.cpp, servoAfma6FourPoints2DArtVelocity.cpp, servoAfma6FourPoints2DCamVelocityInteractionCurrent.cpp, servoAfma6FourPoints2DCamVelocityInteractionDesired.cpp, servoAfma6Line2DCamVelocity.cpp, servoAfma6Point2DArtVelocity.cpp, servoAfma6Point2DCamVelocity.cpp, servoAfma6Points2DCamVelocityEyeToHand.cpp, servoAfma6Segment2DCamVelocity.cpp, servoAfma6SquareLines2DCamVelocity.cpp, servoAfma6TwoLines2DCamVelocity.cpp, servoBiclopsPoint2DArtVelocity.cpp, servoMomentImage.cpp, servoMomentPoints.cpp, servoMomentPolygon.cpp, servoPioneerPanSegment3D.cpp, servoPioneerPoint2DDepth.cpp, servoPioneerPoint2DDepthWithoutVpServo.cpp, servoPtu46Point2DArtVelocity.cpp, servoSimu4Points.cpp, servoSimuAfma6FourPoints2DCamVelocity.cpp, servoSimuCircle2DCamVelocityDisplay.cpp, servoSimuCylinder.cpp, servoSimuCylinder2DCamVelocityDisplay.cpp, servoSimuCylinder2DCamVelocityDisplaySecondaryTask.cpp, servoSimuFourPoints2DCamVelocityDisplay.cpp, servoSimuFourPoints2DPolarCamVelocityDisplay.cpp, servoSimuLine2DCamVelocityDisplay.cpp, servoSimuSphere.cpp, servoSimuSquareLine2DCamVelocityDisplay.cpp, servoSimuViper850FourPoints2DCamVelocity.cpp, servoViper650FourPoints2DArtVelocityInteractionCurrent.cpp, servoViper650FourPoints2DCamVelocityInteractionCurrent.cpp, servoViper650Point2DCamVelocity.cpp, servoViper850FourPoints2DArtVelocityInteractionCurrent.cpp, servoViper850FourPoints2DArtVelocityInteractionDesired.cpp, servoViper850FourPoints2DCamVelocityInteractionCurrent.cpp, servoViper850FourPointsKinect.cpp, servoViper850Point2DArtVelocity-jointAvoidance-basic.cpp, servoViper850Point2DArtVelocity-jointAvoidance-gpa.cpp, servoViper850Point2DArtVelocity.cpp, servoViper850Point2DCamVelocity.cpp, servoViper850Point2DCamVelocityKalman.cpp, SickLDMRS-Process.cpp, sonarPioneerReader.cpp, templateTracker.cpp, testClick.cpp, testDisplayRoi.cpp, testDisplays.cpp, testFeatureSegment.cpp, testMouseEvent.cpp, testRobotAfma6Pose.cpp, testRobotViper850Pose.cpp, testSurfKeyPoint.cpp, testTrackDot.cpp, testVideoDevice.cpp, testVideoDeviceDual.cpp, trackDot.cpp, trackDot2.cpp, trackDot2WithAutoDetection.cpp, trackKltOpencv.cpp, trackMeCircle.cpp, trackMeEllipse.cpp, trackMeLine.cpp, trackMeNurbs.cpp, tutorial-barcode-detector-live.cpp, tutorial-barcode-detector.cpp, tutorial-blob-auto-tracker.cpp, tutorial-blob-tracker-live-firewire.cpp, tutorial-blob-tracker-live-v4l2.cpp, tutorial-detection-object-mbt.cpp, tutorial-face-detector-live.cpp, tutorial-face-detector.cpp, tutorial-grabber-1394-writer.cpp, tutorial-grabber-1394.cpp, tutorial-grabber-CMU1394.cpp, tutorial-grabber-opencv-bis.cpp, tutorial-grabber-opencv.cpp, tutorial-grabber-v4l2.cpp, tutorial-ibvs-4pts-display.cpp, tutorial-ibvs-4pts-image-tracking.cpp, tutorial-ibvs-4pts-ogre-tracking.cpp, tutorial-ibvs-4pts-wireframe-camera.cpp, tutorial-ibvs-4pts-wireframe-robot-afma6.cpp, tutorial-ibvs-4pts-wireframe-robot-viper.cpp, tutorial-image-filter.cpp, tutorial-image-simulator.cpp, tutorial-image-viewer.cpp, tutorial-klt-tracker-live-v4l2.cpp, tutorial-klt-tracker-with-reinit.cpp, tutorial-klt-tracker.cpp, tutorial-matching-keypoint-homography.cpp, tutorial-matching-keypoint-SIFT.cpp, tutorial-matching-keypoint.cpp, tutorial-matching-surf-deprecated.cpp, tutorial-matching-surf-homography-deprecated.cpp, tutorial-mb-edge-tracker.cpp, tutorial-mb-hybrid-tracker.cpp, tutorial-mb-klt-tracker.cpp, tutorial-me-ellipse-tracker.cpp, tutorial-me-line-tracker.cpp, tutorial-pose-from-points-image.cpp, tutorial-pose-from-points-tracking.cpp, tutorial-simu-pioneer-continuous-gain-adaptive.cpp, tutorial-simu-pioneer-continuous-gain-constant.cpp, tutorial-simu-pioneer-pan.cpp, tutorial-simu-pioneer.cpp, tutorial-template-tracker.cpp, tutorial-video-reader.cpp, tutorial-video-recorder.cpp, tutorial-viewer.cpp, videoReader.cpp, and wireframeSimulator.cpp.

Definition at line 2232 of file vpDisplay.cpp.

References vpImage< Type >::display, vpDisplay::flushDisplay(), and vpERROR_TRACE.

Referenced by vpMbtDistanceCylinder::computeInteractionMatrixError(), vpDot2::defineDots(), vpMbtDistanceCircle::displayMovingEdges(), vpTemplateTrackerZone::initClick(), vpPolygon::initClick(), vpMbTracker::initClick(), vpMeEllipse::initTracking(), vpMeNurbs::initTracking(), vpMeLine::initTracking(), vpDot2::searchDotsInArea(), vpSimulatorAfma6::setPosition(), vpMeEllipse::track(), vpMeLine::track(), vpDot2::trackAndDisplay(), vpSimulatorAfma6::updateArticularPosition(), and vpSimulatorViper850::updateArticularPosition().

void vpDisplay::flush ( const vpImage< vpRGBa > &  I)
staticinherited

Flushes the output buffer associated to image I display. It's necessary to use this function to see the results of any drawing.

Warning
This function is particular and must be called to show the overlay. Because it's time spending, use it parcimoniously.
#include <visp/vpDisplay.h>
#include <visp/vpDisplayGDI.h>
#include <visp/vpColor.h>
#include <visp/vpImage.h>
#include <visp/vpImagePoint.h>
#include <visp/vpRGBa.h>
int main() {
vpImage<vpRGBa> I(240, 380);
d.init(I);
vpDisplay::display(I); // display the image
vpImagePoint center;
unsigned int radius = 100;
vpDisplay::flush(I); // Mendatory to display the requested features.
}

Definition at line 2575 of file vpDisplay.cpp.

References vpImage< Type >::display, vpDisplay::flushDisplay(), and vpERROR_TRACE.

void vpDisplayOpenCV::flushDisplay ( )
protectedvirtual

Flushes the OpenCV buffer. It's necessary to use this function to see the results of any drawing.

Implements vpDisplay.

Definition at line 853 of file vpDisplayOpenCV.cpp.

References vpDisplay::displayHasBeenInitialized, vpDisplayException::notInitializedError, vpDisplay::title_, and vpERROR_TRACE.

Referenced by getClick(), and getKeyboardEvent().

void vpDisplayOpenCV::flushDisplayROI ( const vpImagePoint iP,
const unsigned int  width,
const unsigned int  height 
)
protectedvirtual

Flushes the OpenCV buffer. It's necessary to use this function to see the results of any drawing.

Implements vpDisplay.

Definition at line 878 of file vpDisplayOpenCV.cpp.

References vpDisplay::displayHasBeenInitialized, vpDisplayException::notInitializedError, vpDisplay::title_, and vpERROR_TRACE.

void vpDisplay::flushROI ( const vpImage< unsigned char > &  I,
const vpRect roi 
)
staticinherited
void vpDisplay::flushROI ( const vpImage< vpRGBa > &  I,
const vpRect roi 
)
staticinherited
bool vpDisplayOpenCV::getClick ( bool  blocking = true)
protectedvirtual

Wait for a click from one of the mouse button.

Parameters
blocking[in] : Blocking behavior.
  • When set to true, this method waits until a mouse button is pressed and then returns always true.
  • When set to false, returns true only if a mouse button is pressed, otherwise returns false.
Returns
  • true if a button was clicked. This is always the case if blocking is set to true.
  • false if no button was clicked. This can occur if blocking is set to false.

Implements vpDisplay.

Definition at line 1675 of file vpDisplayOpenCV.cpp.

References vpDisplay::displayHasBeenInitialized, flushDisplay(), vpDisplayException::notInitializedError, and vpERROR_TRACE.

bool vpDisplayOpenCV::getClick ( vpImagePoint ip,
bool  blocking = true 
)
protectedvirtual

Wait for a click from one of the mouse button and get the position of the clicked image point.

Parameters
ip[out] : The coordinates of the clicked image point.
blocking[in] : true for a blocking behaviour waiting a mouse button click, false for a non blocking behaviour.
Returns
  • true if a button was clicked. This is always the case if blocking is set to true.
  • false if no button was clicked. This can occur if blocking is set to false.

Implements vpDisplay.

Definition at line 1732 of file vpDisplayOpenCV.cpp.

References vpDisplay::displayHasBeenInitialized, flushDisplay(), vpDisplayException::notInitializedError, vpImagePoint::set_u(), vpImagePoint::set_v(), and vpERROR_TRACE.

bool vpDisplayOpenCV::getClick ( vpImagePoint ip,
vpMouseButton::vpMouseButtonType button,
bool  blocking = true 
)
protectedvirtual

Wait for a mouse button click and get the position of the clicked pixel. The button used to click is also set.

Parameters
ip[out] : The coordinates of the clicked image point.
button[out] : The button used to click.
blocking[in] :
  • When set to true, this method waits until a mouse button is pressed and then returns always true.
  • When set to false, returns true only if a mouse button is pressed, otherwise returns false.
Returns
true if a mouse button is pressed, false otherwise. If a button is pressed, the location of the mouse pointer is updated in ip.

Implements vpDisplay.

Definition at line 1808 of file vpDisplayOpenCV.cpp.

References vpMouseButton::button1, vpMouseButton::button2, vpMouseButton::button3, vpDisplay::displayHasBeenInitialized, vpDisplayException::notInitializedError, vpImagePoint::set_u(), vpImagePoint::set_v(), and vpERROR_TRACE.

bool vpDisplay::getClick ( const vpImage< unsigned char > &  I,
bool  blocking = true 
)
staticinherited

Wait for a click from one of the mouse button.

Parameters
I[in] : The displayed image.
blocking[in] : Blocking behavior.
  • When set to true, this method waits until a mouse button is pressed and then returns always true.
  • When set to false, returns true only if a mouse button is pressed, otherwise returns false.
Returns
  • true if a button was clicked. This is always the case if blocking is set to true.
  • false if no button was clicked. This can occur if blocking is set to false.

Definition at line 2647 of file vpDisplay.cpp.

References vpImage< Type >::display, and vpERROR_TRACE.

bool vpDisplay::getClick ( const vpImage< unsigned char > &  I,
vpImagePoint ip,
bool  blocking = true 
)
staticinherited

Wait for a click from one of the mouse button and get the position of the clicked image point.

Parameters
I[in] : The displayed image.
ip[out] : The coordinates of the clicked image point.
blocking[in] : Blocking behavior.
  • When set to true, this method waits until a mouse button is pressed and then returns always true.
  • When set to false, returns true only if a mouse button is pressed, otherwise returns false.
Returns
true if a mouse button is pressed, false otherwise. If a button is pressed, the location of the mouse pointer is updated in ip.

Definition at line 2684 of file vpDisplay.cpp.

References vpImage< Type >::display, and vpERROR_TRACE.

bool vpDisplay::getClick ( const vpImage< unsigned char > &  I,
vpImagePoint ip,
vpMouseButton::vpMouseButtonType button,
bool  blocking = true 
)
staticinherited

Wait for a mouse button click and get the position of the clicked image point. The button used to click is also set.

Parameters
I[in] : The displayed image.
ip[out] : The coordinates of the clicked image point.
button[out] : The button used to click.
blocking[in] :
  • When set to true, this method waits until a mouse button is pressed and then returns always true.
  • When set to false, returns true only if a mouse button is pressed, otherwise returns false.
Returns
true if a mouse button is pressed, false otherwise. If a button is pressed, the location of the mouse pointer is updated in ip.

Definition at line 2723 of file vpDisplay.cpp.

References vpImage< Type >::display, and vpERROR_TRACE.

bool vpDisplay::getClick ( const vpImage< unsigned char > &  I,
vpMouseButton::vpMouseButtonType button,
bool  blocking = true 
)
staticinherited

Wait for a mouse button click and get the position of the clicked image point. The button used to click is also set.

Parameters
I[in] : The displayed image.
button[out] : The button used to click.
blocking[in] :
  • When set to true, this method waits until a mouse button is pressed and then returns always true.
  • When set to false, returns true only if a mouse button is pressed, otherwise returns false.
Returns
true if a mouse button is pressed, false otherwise.

Definition at line 2760 of file vpDisplay.cpp.

References vpDisplay::getClick().

bool vpDisplay::getClick ( const vpImage< vpRGBa > &  I,
bool  blocking = true 
)
staticinherited

Wait for a click.

Parameters
I[in] : The displayed image.
blocking[in] :
  • When set to true, this method waits until a mouse button is pressed and then returns always true.
  • When set to false, returns true only if a mouse button is pressed, otherwise returns false.
Returns
true if a mouse button is pressed, false otherwise.

Definition at line 3166 of file vpDisplay.cpp.

References vpImage< Type >::display, and vpERROR_TRACE.

bool vpDisplay::getClick ( const vpImage< vpRGBa > &  I,
vpImagePoint ip,
bool  blocking = true 
)
staticinherited

Return true when a mouse button is pressed.

Parameters
I[in] : The displayed image.
ip[out] : The coordinates of the clicked image point.
blocking[in] :
  • When set to true, this method waits until a mouse button is pressed and then returns always true.
  • When set to false, returns true only if a mouse button is pressed, otherwise returns false.
Returns
true if a mouse button is pressed, false otherwise. If a button is pressed, the location of the mouse pointer is updated in ip.

Definition at line 3202 of file vpDisplay.cpp.

References vpImage< Type >::display, and vpERROR_TRACE.

bool vpDisplay::getClick ( const vpImage< vpRGBa > &  I,
vpImagePoint ip,
vpMouseButton::vpMouseButtonType button,
bool  blocking = true 
)
staticinherited

Return true when a mouse button is pressed.

Parameters
I[in] : The displayed image.
ip[out] : The coordinates of the clicked image point.
button[out] : The clicked button.
blocking[in] :
  • When set to true, this method waits until a mouse button is pressed and then returns always true.
  • When set to false, returns true only if a mouse button is pressed, otherwise returns false.
Returns
true if a mouse button is pressed, false otherwise. If a button is pressed, the location of the mouse pointer is updated in ip.

Definition at line 3240 of file vpDisplay.cpp.

References vpImage< Type >::display, and vpERROR_TRACE.

bool vpDisplay::getClick ( const vpImage< vpRGBa > &  I,
vpMouseButton::vpMouseButtonType button,
bool  blocking = true 
)
staticinherited

Wait for a mouse button click and get the position of the clicked image point. The button used to click is also set.

Parameters
I[in] : The displayed image.
button[out] : The button used to click.
blocking[in] :
  • When set to true, this method waits until a mouse button is pressed and then returns always true.
  • When set to false, returns true only if a mouse button is pressed, otherwise returns false.
Returns
true if a mouse button is pressed, false otherwise.

Definition at line 2785 of file vpDisplay.cpp.

References vpDisplay::getClick().

bool vpDisplayOpenCV::getClickUp ( vpImagePoint ip,
vpMouseButton::vpMouseButtonType button,
bool  blocking = true 
)
protectedvirtual

Wait for a mouse button click release and get the position of the image point were the click release occurs. The button used to click is also set. Same method as getClick(unsigned int&, unsigned int&, vpMouseButton::vpMouseButtonType &, bool).

Parameters
ip[out] : Position of the clicked image point.
button[in] : Button used to click.
blocking[in] : true for a blocking behaviour waiting a mouse button click, false for a non blocking behaviour.
Returns
  • true if a button was clicked. This is always the case if blocking is set to true.
  • false if no button was clicked. This can occur if blocking is set to false.
See also
getClick(vpImagePoint &, vpMouseButton::vpMouseButtonType &, bool)

Implements vpDisplay.

Definition at line 1890 of file vpDisplayOpenCV.cpp.

References vpMouseButton::button1, vpMouseButton::button2, vpMouseButton::button3, vpDisplay::displayHasBeenInitialized, vpDisplayException::notInitializedError, vpImagePoint::set_u(), vpImagePoint::set_v(), and vpERROR_TRACE.

bool vpDisplay::getClickUp ( const vpImage< unsigned char > &  I,
vpImagePoint ip,
vpMouseButton::vpMouseButtonType button,
bool  blocking = true 
)
staticinherited

Wait for a mouse button click release and get the position of the clicked image point. The button used to click is also set.

Parameters
I[in] : The displayed image.
ip[out] : The coordinates of the clicked image point.
button[out] : The clicked button.
blocking[in] :
  • When set to true, this method waits until a mouse button is released and then returns always true.
  • When set to false, returns true only if a mouse button is released, otherwise returns false.
Returns
true if a mouse button is released, false otherwise. If a button is released, the location of the mouse pointer is updated in ip.

Definition at line 2815 of file vpDisplay.cpp.

References vpImage< Type >::display, and vpERROR_TRACE.

bool vpDisplay::getClickUp ( const vpImage< unsigned char > &  I,
vpMouseButton::vpMouseButtonType button,
bool  blocking = true 
)
staticinherited

Wait for a mouse button click release and get the position of the clicked image point. The button used to click is also set.

Parameters
I[in] : The displayed image.
button[out] : The clicked button.
blocking[in] :
  • When set to true, this method waits until a mouse button is released and then returns always true.
  • When set to false, returns true only if a mouse button is released, otherwise returns false.
Returns
true if a mouse button is released, false otherwise.

Definition at line 2852 of file vpDisplay.cpp.

References vpDisplay::getClickUp().

bool vpDisplay::getClickUp ( const vpImage< vpRGBa > &  I,
vpImagePoint ip,
vpMouseButton::vpMouseButtonType button,
bool  blocking = true 
)
staticinherited

Return true when a mouse button is released.

Parameters
I[in] : The displayed image.
ip[out] : The coordinates of the clicked image point.
button[out] : The clicked button.
blocking[in] :
  • When set to true, this method waits until a mouse button is released and then returns always true.
  • When set to false, returns true only if a mouse button is released, otherwise returns false.
Returns
true if a mouse button is released, false otherwise. If a button is released, the location of the mouse pointer is updated in ip.

Definition at line 3281 of file vpDisplay.cpp.

References vpImage< Type >::display, and vpERROR_TRACE.

bool vpDisplay::getClickUp ( const vpImage< vpRGBa > &  I,
vpMouseButton::vpMouseButtonType button,
bool  blocking = true 
)
staticinherited

Wait for a mouse button click release and get the position of the clicked image point. The button used to click is also set.

Parameters
I[in] : The displayed image.
button[out] : The clicked button.
blocking[in] :
  • When set to true, this method waits until a mouse button is released and then returns always true.
  • When set to false, returns true only if a mouse button is released, otherwise returns false.
Returns
true if a mouse button is released, false otherwise.

Definition at line 2877 of file vpDisplay.cpp.

References vpDisplay::getClickUp().

unsigned int vpDisplayOpenCV::getHeight ( ) const
inlineprotected

Definition at line 273 of file vpDisplayOpenCV.h.

References vpDisplay::height.

void vpDisplayOpenCV::getImage ( vpImage< vpRGBa > &  I)
virtual

get the window pixmap and put it in vpRGBa image

Implements vpDisplay.

Definition at line 1951 of file vpDisplayOpenCV.cpp.

References vpImageConvert::convert().

void vpDisplay::getImage ( const vpImage< unsigned char > &  Isrc,
vpImage< vpRGBa > &  Idest 
)
staticinherited

Get the window pixmap and put it in vpRGBa image.

The code below shows how to use this method.

#include <visp/vpConfig.h>
#include <visp/vpImageIo.h>
#include <visp/vpDisplayX.h>
#include <visp/vpDisplayGTK.h>
#include <visp/vpDisplayGDI.h>
#include <visp/vpDisplayD3D.h>
#include <visp/vpDisplayOpenCV.h>
int main()
{
vpImage<unsigned char> I(240, 320); // Create a black grey level image
vpImage<vpRGBa> Ioverlay;
// Depending on the detected third party libraries, we instantiate here the
// first video device which is available
#if defined(VISP_HAVE_X11)
d = new vpDisplayX;
#elif defined(VISP_HAVE_GTK)
d = new vpDisplayGTK;
#elif defined(VISP_HAVE_GDI)
d = new vpDisplayGDI;
#elif defined(VISP_HAVE_D3D9)
d = new vpDisplayD3D;
#elif defined(VISP_HAVE_OPENCV)
d = new vpDisplayOpenCV;
#endif
// Initialize the display with the image I. Display and image are
// now link together.
#ifdef VISP_HAVE_DISPLAY
d->init(I);
#endif
// Set the display background with image I content
// Draw a red rectangle in the display overlay (foreground)
vpDisplay::displayRectangle(I, 10, 10, 100, 20, vpColor::red, true);
// Flush the foreground and background display
// Updates the color image with the original loaded image and the overlay
vpDisplay::getImage(I, Ioverlay) ;
// Write the color image on the disk
std::string ofilename("overlay.ppm");
vpImageIo::write(Ioverlay, ofilename) ;
// Wait for a click in the display window
#ifdef VISP_HAVE_DISPLAY
delete d;
#endif
}
Examples:
displayD3D.cpp, displayGTK.cpp, displayOpenCV.cpp, displayX.cpp, displayXMulti.cpp, manDisplay.cpp, manGeometricFeatures.cpp, servoAfma6Points2DCamVelocityEyeToHand.cpp, sonarPioneerReader.cpp, and tutorial-image-viewer.cpp.

Definition at line 328 of file vpDisplay.cpp.

References vpImageConvert::convert(), vpImage< Type >::display, and vpERROR_TRACE.

Referenced by vpDisplay::getImage().

void vpDisplay::getImage ( const vpImage< vpRGBa > &  Isrc,
vpImage< vpRGBa > &  Idest 
)
staticinherited

Get the window pixmap and put it in vpRGBa image.

The code below shows how to use this method.

#include <visp/vpConfig.h>
#include <visp/vpImageIo.h>
#include <visp/vpDisplayX.h>
#include <visp/vpDisplayGTK.h>
#include <visp/vpDisplayGDI.h>
#include <visp/vpDisplayD3D.h>
#include <visp/vpDisplayOpenCV.h>
int main()
{
vpImage<vpRGBa> I(240, 320); // Create a black RGB color image
vpImage<vpRGBa> Ioverlay;
// Depending on the detected third party libraries, we instantiate here the
// first video device which is available
#if defined(VISP_HAVE_X11)
d = new vpDisplayX;
#elif defined(VISP_HAVE_GTK)
d = new vpDisplayGTK;
#elif defined(VISP_HAVE_GDI)
d = new vpDisplayGDI;
#elif defined(VISP_HAVE_D3D9)
d = new vpDisplayD3D;
#elif defined(VISP_HAVE_OPENCV)
d = new vpDisplayOpenCV;
#endif
// Initialize the display with the image I. Display and image are
// now link together.
#ifdef VISP_HAVE_DISPLAY
d->init(I);
#endif
// Set the display background with image I content
// Draw a red rectangle in the display overlay (foreground)
vpDisplay::displayRectangle(I, 10, 10, 100, 20, vpColor::red, true);
// Flush the foreground and background display
// Updates the color image with the original loaded image and the overlay
vpDisplay::getImage(I, Ioverlay) ;
// Write the color image on the disk
std::string ofilename("overlay.ppm");
vpImageIo::write(Ioverlay, ofilename) ;
// Wait for a click in the display window
#ifdef VISP_HAVE_DISPLAY
delete d;
#endif
}

Definition at line 2526 of file vpDisplay.cpp.

References vpImage< Type >::display, vpDisplay::getImage(), and vpERROR_TRACE.

bool vpDisplayOpenCV::getKeyboardEvent ( bool  blocking = true)
protectedvirtual

Get a keyboard event.

Parameters
blocking[in] : Blocking behavior.
  • When set to true, this method waits until a key is pressed and then returns always true.
  • When set to false, returns true only if a key is pressed, otherwise returns false.
Returns
  • true if a key was pressed. This is always the case if blocking is set to true.
  • false if no key was pressed. This can occur if blocking is set to false.

Implements vpDisplay.

Definition at line 2062 of file vpDisplayOpenCV.cpp.

References vpDisplay::displayHasBeenInitialized, flushDisplay(), vpDisplayException::notInitializedError, and vpERROR_TRACE.

bool vpDisplayOpenCV::getKeyboardEvent ( char *  string,
bool  blocking = true 
)
protectedvirtual

Get a keyboard event.

Parameters
blocking[in] : Blocking behavior.
  • When set to true, this method waits until a key is pressed and then returns always true.
  • When set to false, returns true only if a key is pressed, otherwise returns false.
string[out]: If possible, an ISO Latin-1 character corresponding to the keyboard key.
Returns
  • true if a key was pressed. This is always the case if blocking is set to true.
  • false if no key was pressed. This can occur if blocking is set to false.

Implements vpDisplay.

Definition at line 2110 of file vpDisplayOpenCV.cpp.

References vpDisplay::displayHasBeenInitialized, flushDisplay(), vpDisplayException::notInitializedError, and vpERROR_TRACE.

bool vpDisplay::getKeyboardEvent ( const vpImage< unsigned char > &  I,
bool  blocking = true 
)
staticinherited

Get a keyboard event.

Parameters
I[in] : The displayed image.
blocking[in] : Blocking behavior.
  • When set to true, this method waits until a key is pressed and then returns always true.
  • When set to false, returns true only if a key is pressed, otherwise returns false.
Returns
  • true if a key was pressed. This is always the case if blocking is set to true.
  • false if no key was pressed. This can occur if blocking is set to false.

Below you will find an example showing how to use this method.

#include <visp/vpConfig.h>
#include <visp/vpDisplayOpenCV.h>
#include <visp/vpDisplayX.h>
#include <visp/vpDisplayGTK.h>
#include <visp/vpDisplayGDI.h>
#include <visp/vpDisplayD3D.h>
int main()
{
vpImage<unsigned char> I(240, 320); // Create a black image
#if defined(VISP_HAVE_X11)
d = new vpDisplayX;
#elif defined(VISP_HAVE_GTK)
d = new vpDisplayGTK;
#elif defined(VISP_HAVE_GDI)
d = new vpDisplayGDI;
#elif defined(VISP_HAVE_D3D9)
d = new vpDisplayD3D;
#elif defined(VISP_HAVE_OPENCV)
d = new vpDisplayOpenCV;
#else
std::cout << "Sorry, no video device is available" << std::endl;
return -1;
#endif
// Initialize the display with the image I. Display and image are
// now link together.
#ifdef VISP_HAVE_DISPLAY
d->init(I);
#endif
// Set the display background with image I content
// Flush the foreground and background display
// Wait for keyboard event
std::cout << "Waiting a keyboard event..." << std::endl;
std::cout << "A keyboard event was detected" << std::endl;
// Non blocking keyboard event loop
int cpt_event = 0;
bool event;
char key[10];
std::cout << "Enter a non blocking keyboard event detection loop..." << std::endl;
do {
event = vpDisplay::getKeyboardEvent(I, &key[0], false);
if (event) {
std::cout << "Key detected: " << key << std::endl;
cpt_event ++;
}
vpTime::wait(5); // wait 5 ms
} while(cpt_event < 5);
#ifdef VISP_HAVE_DISPLAY
delete d;
#endif
}

Definition at line 2971 of file vpDisplay.cpp.

References vpImage< Type >::display, and vpERROR_TRACE.

bool vpDisplay::getKeyboardEvent ( const vpImage< unsigned char > &  I,
char *  string,
bool  blocking = true 
)
staticinherited

Get a keyboard event.

Parameters
I[in] : The displayed image.
blocking[in] : Blocking behavior.
  • When set to true, this method waits until a key is pressed and then returns always true.
  • When set to false, returns true only if a key is pressed, otherwise returns false.
string[out]: If possible, an ISO Latin-1 character corresponding to the keyboard key.
Returns
  • true if a key was pressed. This is always the case if blocking is set to true.
  • false if no key was pressed. This can occur if blocking is set to false.

Below you will find an example showing how to use this method.

#include <visp/vpConfig.h>
#include <visp/vpDisplayOpenCV.h>
#include <visp/vpDisplayX.h>
#include <visp/vpDisplayGTK.h>
#include <visp/vpDisplayGDI.h>
#include <visp/vpDisplayD3D.h>
int main()
{
vpImage<unsigned char> I(240, 320); // Create a black image
#if defined(VISP_HAVE_X11)
d = new vpDisplayX;
#elif defined(VISP_HAVE_GTK)
d = new vpDisplayGTK;
#elif defined(VISP_HAVE_GDI)
d = new vpDisplayGDI;
#elif defined(VISP_HAVE_D3D9)
d = new vpDisplayD3D;
#elif defined(VISP_HAVE_OPENCV)
d = new vpDisplayOpenCV;
#else
std::cout << "Sorry, no video device is available" << std::endl;
return -1;
#endif
// Initialize the display with the image I. Display and image are
// now link together.
#ifdef VISP_HAVE_DISPLAY
d->init(I);
#endif
// Set the display background with image I content
// Flush the foreground and background display
// Wait for keyboard event
std::cout << "Waiting a keyboard event..." << std::endl;
std::cout << "A keyboard event was detected" << std::endl;
// Non blocking keyboard event loop
int cpt_event = 0;
bool event;
char key[10];
std::cout << "Enter a non blocking keyboard event detection loop..." << std::endl;
do {
event = vpDisplay::getKeyboardEvent(I, &key[0], false);
if (event) {
std::cout << "Key detected: " << key << std::endl;
cpt_event ++;
}
vpTime::wait(5); // wait 5 ms
} while(cpt_event < 5);
#ifdef VISP_HAVE_DISPLAY
delete d;
#endif
}

Definition at line 3078 of file vpDisplay.cpp.

References vpImage< Type >::display, and vpERROR_TRACE.

bool vpDisplay::getKeyboardEvent ( const vpImage< vpRGBa > &  I,
bool  blocking = true 
)
staticinherited

Get a keyboard event.

Parameters
I[in] : The displayed image.
blocking[in] : Blocking behavior.
  • When set to true, this method waits until a key is pressed and then returns always true.
  • When set to false, returns true only if a key is pressed, otherwise returns false.
Returns
  • true if a key was pressed. This is always the case if blocking is set to true.
  • false if no key was pressed. This can occur if blocking is set to false.

Below you will find an example showing how to use this method.

#include <visp/vpConfig.h>
#include <visp/vpDisplayOpenCV.h>
#include <visp/vpDisplayX.h>
#include <visp/vpDisplayGTK.h>
#include <visp/vpDisplayGDI.h>
#include <visp/vpDisplayD3D.h>
int main()
{
vpImage<vpRGBa> I(240, 320); // Create a black RGB color image
#if defined(VISP_HAVE_X11)
d = new vpDisplayX;
#elif defined(VISP_HAVE_GTK)
d = new vpDisplayGTK;
#elif defined(VISP_HAVE_GDI)
d = new vpDisplayGDI;
#elif defined(VISP_HAVE_D3D9)
d = new vpDisplayD3D;
#elif defined(VISP_HAVE_OPENCV)
d = new vpDisplayOpenCV;
#else
std::cout << "Sorry, no video device is available" << std::endl;
return -1;
#endif
// Initialize the display with the image I. Display and image are
// now link together.
#ifdef VISP_HAVE_DISPLAY
d->init(I);
#endif
// Set the display background with image I content
// Flush the foreground and background display
// Wait for keyboard event
std::cout << "Waiting a keyboard event..." << std::endl;
std::cout << "A keyboard event was detected" << std::endl;
// Non blocking keyboard event loop
int cpt_event = 0;
bool event;
char key[10];
std::cout << "Enter a non blocking keyboard event detection loop..." << std::endl;
do {
event = vpDisplay::getKeyboardEvent(I, &key[0], false);
if (event) {
std::cout << "Key detected: " << key << std::endl;
cpt_event ++;
}
vpTime::wait(5); // wait 5 ms
} while(cpt_event < 5);
#ifdef VISP_HAVE_DISPLAY
delete d;
#endif
}

Definition at line 3386 of file vpDisplay.cpp.

References vpImage< Type >::display, and vpERROR_TRACE.

bool vpDisplay::getKeyboardEvent ( const vpImage< vpRGBa > &  I,
char *  string,
bool  blocking = true 
)
staticinherited

Get a keyboard event.

Parameters
I[in] : The displayed image.
blocking[in] : Blocking behavior.
  • When set to true, this method waits until a key is pressed and then returns always true.
  • When set to false, returns true only if a key is pressed, otherwise returns false.
string[out]: If possible, an ISO Latin-1 character corresponding to the keyboard key.
Returns
  • true if a key was pressed. This is always the case if blocking is set to true.
  • false if no key was pressed. This can occur if blocking is set to false.

Below you will find an example showing how to use this method.

#include <visp/vpConfig.h>
#include <visp/vpDisplayOpenCV.h>
#include <visp/vpDisplayX.h>
#include <visp/vpDisplayGTK.h>
#include <visp/vpDisplayGDI.h>
#include <visp/vpDisplayD3D.h>
int main()
{
vpImage<vpRGBa> I(240, 320); // Create a black RGB color image
#if defined(VISP_HAVE_X11)
d = new vpDisplayX;
#elif defined(VISP_HAVE_GTK)
d = new vpDisplayGTK;
#elif defined(VISP_HAVE_GDI)
d = new vpDisplayGDI;
#elif defined(VISP_HAVE_D3D9)
d = new vpDisplayD3D;
#elif defined(VISP_HAVE_OPENCV)
d = new vpDisplayOpenCV;
#else
std::cout << "Sorry, no video device is available" << std::endl;
return -1;
#endif
// Initialize the display with the image I. Display and image are
// now link together.
#ifdef VISP_HAVE_DISPLAY
d->init(I);
#endif
// Set the display background with image I content
// Flush the foreground and background display
// Wait for keyboard event
std::cout << "Waiting a keyboard event..." << std::endl;
std::cout << "A keyboard event was detected" << std::endl;
// Non blocking keyboard event loop
int cpt_event = 0;
bool event;
char key[10];
std::cout << "Enter a non blocking keyboard event detection loop..." << std::endl;
do {
event = vpDisplay::getKeyboardEvent(I, &key[0], false);
if (event) {
std::cout << "Key detected: " << key << std::endl;
cpt_event ++;
}
vpTime::wait(5); // wait 5 ms
} while(cpt_event < 5);
delete d;
}

Definition at line 3491 of file vpDisplay.cpp.

References vpImage< Type >::display, and vpERROR_TRACE.

bool vpDisplayOpenCV::getPointerMotionEvent ( vpImagePoint ip)
protectedvirtual

Get the coordinates of the mouse pointer.

Warning
Not implemented yet.
Parameters
ip[out] : The coordinates of the mouse pointer.
Returns
true if a pointer motion event was received, false otherwise.
Exceptions
vpDisplayException::notInitializedError: If the display was not initialized.

Implements vpDisplay.

Definition at line 2155 of file vpDisplayOpenCV.cpp.

References vpDisplay::displayHasBeenInitialized, vpDisplayException::notInitializedError, vpImagePoint::set_u(), vpImagePoint::set_v(), and vpERROR_TRACE.

Referenced by getPointerPosition().

bool vpDisplay::getPointerMotionEvent ( const vpImage< unsigned char > &  I,
vpImagePoint ip 
)
staticinherited

Get the coordinates of the mouse pointer.

Parameters
I[in] : The displayed image.
ip[out] : The coordinates of the mouse pointer.
Returns
true if a pointer motion event was received, false otherwise.

Definition at line 3106 of file vpDisplay.cpp.

References vpImage< Type >::display, and vpERROR_TRACE.

bool vpDisplay::getPointerMotionEvent ( const vpImage< vpRGBa > &  I,
vpImagePoint ip 
)
staticinherited

Get the coordinates of the mouse pointer.

Parameters
I[in] : The displayed image.
ip[out] : The coordinates of the mouse pointer.
Returns
true if a pointer motion event was received, false otherwise.

Definition at line 3519 of file vpDisplay.cpp.

References vpImage< Type >::display, and vpERROR_TRACE.

bool vpDisplayOpenCV::getPointerPosition ( vpImagePoint ip)
protectedvirtual

Get the coordinates of the mouse pointer.

Parameters
ip[out] : The coordinates of the mouse pointer.
Returns
true.
Exceptions
vpDisplayException::notInitializedError: If the display was not initialized.

Implements vpDisplay.

Definition at line 2191 of file vpDisplayOpenCV.cpp.

References vpDisplay::displayHasBeenInitialized, getPointerMotionEvent(), vpDisplayException::notInitializedError, vpImagePoint::set_u(), vpImagePoint::set_v(), and vpERROR_TRACE.

bool vpDisplay::getPointerPosition ( const vpImage< unsigned char > &  I,
vpImagePoint ip 
)
staticinherited

Get the coordinates of the mouse pointer.

Parameters
I[in] : The displayed image.
ip[out] : The coordinates of the mouse pointer.
Returns
true.

Definition at line 3135 of file vpDisplay.cpp.

References vpImage< Type >::display, and vpERROR_TRACE.

bool vpDisplay::getPointerPosition ( const vpImage< vpRGBa > &  I,
vpImagePoint ip 
)
staticinherited

Get the coordinates of the mouse pointer.

Parameters
I[in] : The displayed image.
ip[out] : The coordinates of the mouse pointer.
Returns
true.

Definition at line 3546 of file vpDisplay.cpp.

References vpImage< Type >::display, and vpERROR_TRACE.

unsigned int vpDisplayOpenCV::getWidth ( ) const
inlineprotected

Definition at line 272 of file vpDisplayOpenCV.h.

References vpDisplay::width.

int vpDisplay::getWindowXPosition ( ) const
inlineinherited

Return the position (along the horizontal axis) on the screen of the display window.

See also
getWindowYPosition()

Definition at line 360 of file vpDisplay.h.

Referenced by vpMbTracker::initClick().

int vpDisplay::getWindowYPosition ( ) const
inlineinherited

Return the position (along the vertical axis) on the screen of the display window.

See also
getWindowXPosition()

Definition at line 365 of file vpDisplay.h.

Referenced by vpMbTracker::initClick().

void vpDisplayOpenCV::init ( vpImage< unsigned char > &  I,
int  x = -1,
int  y = -1,
const char *  title = NULL 
)
virtual
void vpDisplayOpenCV::init ( vpImage< vpRGBa > &  I,
int  x = -1,
int  y = -1,
const char *  title = NULL 
)
virtual

Initialize the display (size, position and title) of a color image in RGBa format.

Parameters
I: Image to be displayed (not that image has to be initialized)
x,y: The window is set at position x,y (column index, row index).
title: Window title.

Implements vpDisplay.

Definition at line 294 of file vpDisplayOpenCV.cpp.

References vpImage< Type >::display, vpDisplay::displayHasBeenInitialized, vpImage< Type >::getHeight(), vpImage< Type >::getWidth(), init(), vpDisplayException::notInitializedError, and vpERROR_TRACE.

void vpDisplayOpenCV::init ( unsigned int  w,
unsigned int  h,
int  x = -1,
int  y = -1,
const char *  title = NULL 
)
virtual
bool vpDisplay::isInitialised ( )
inlineinherited

Check if the display has been initialised

Returns
True if the display has been initialised, otherwise False

Definition at line 571 of file vpDisplay.h.

Referenced by vpPlot::setFont().

void vpDisplayOpenCV::on_mouse ( int  event,
int  x,
int  y,
int  flags,
void *  param 
)
staticprotected

Definition at line 1957 of file vpDisplayOpenCV.cpp.

Referenced by init().

void vpDisplay::setBackground ( const vpImage< unsigned char > &  I,
const vpColor color 
)
staticinherited

Set the window background.

Parameters
I: Image associated to the display window.
colorBackground color.
Exceptions
vpDisplayException::notInitializedError: If the video device is not initialized.

Definition at line 182 of file vpDisplay.cpp.

References vpDisplay::clearDisplay(), vpImage< Type >::display, and vpERROR_TRACE.

void vpDisplay::setBackground ( const vpImage< vpRGBa > &  I,
const vpColor color 
)
staticinherited

Set the window background.

Parameters
I: Image associated to the display window.
colorBackground color.
Exceptions
vpDisplayException::notInitializedError: If the video device is not initialized.

Definition at line 2381 of file vpDisplay.cpp.

References vpDisplay::clearDisplay(), vpImage< Type >::display, and vpERROR_TRACE.

void vpDisplayOpenCV::setFont ( const char *  font)
protectedvirtual
Warning
This method is not yet implemented.

Set the font used to display a text in overlay. The display is performed using displayCharString().

Parameters
font: The expected font name. The available fonts are given by the "xlsfonts" binary. To choose a font you can also use the "xfontsel" binary.
Note
Under UNIX, to know all the available fonts, use the "xlsfonts" binary in a terminal. You can also use the "xfontsel" binary.
See also
displayCharString()

Implements vpDisplay.

Definition at line 471 of file vpDisplayOpenCV.cpp.

References vpERROR_TRACE.

void vpDisplay::setFont ( const vpImage< unsigned char > &  I,
const char *  fontname 
)
staticinherited

Set the font of a text printed in the display overlay. To print a text you may use displayCharString().

Parameters
I: Image associated to the display window.
fontname: The expected font name.
Note
Under UNIX, the available fonts are given by the "xlsfonts" binary. To choose a font you can also use the "xfontsel" binary.
See also
displayCharString()

Definition at line 101 of file vpDisplay.cpp.

References vpImage< Type >::display, vpDisplay::setFont(), and vpERROR_TRACE.

void vpDisplay::setFont ( const vpImage< vpRGBa > &  I,
const char *  fontname 
)
staticinherited

Set the font of a text printed in the display overlay. To print a text you may use displayCharString().

Parameters
I: Image associated to the display window.
fontname: The expected font name.
Note
Under UNIX, the available fonts are given by the "xlsfonts" binary. To choose a font you can also use the "xfontsel" binary.
See also
displayCharString()

Definition at line 2354 of file vpDisplay.cpp.

References vpImage< Type >::display, vpDisplay::setFont(), and vpERROR_TRACE.

void vpDisplayOpenCV::setTitle ( const char *  title)
protectedvirtual

Set the window title.

Warning
This method is not implemented yet.
Parameters
title: Window title.

Implements vpDisplay.

Definition at line 484 of file vpDisplayOpenCV.cpp.

void vpDisplay::setTitle ( const vpImage< unsigned char > &  I,
const char *  windowtitle 
)
staticinherited

Set the windows title.

Note
This functionality is not implemented when vpDisplayOpenCV is used.
Parameters
I: Image associated to the display window.
windowtitle: Window title.

Definition at line 126 of file vpDisplay.cpp.

References vpImage< Type >::display, vpDisplay::setTitle(), and vpERROR_TRACE.

void vpDisplay::setTitle ( const vpImage< vpRGBa > &  I,
const char *  windowtitle 
)
staticinherited

Set the windows title.

Note
This functionality is not implemented when vpDisplayOpenCV is used.
Parameters
I: Image associated to the display window.
windowtitle: Window title.

Definition at line 2296 of file vpDisplay.cpp.

References vpImage< Type >::display, vpDisplay::setTitle(), and vpERROR_TRACE.

void vpDisplayOpenCV::setWindowPosition ( int  winx,
int  winy 
)
protectedvirtual

Set the window position in the screen.

Parameters
winx,winy: Position of the upper-left window's border in the screen.
Exceptions
vpDisplayException::notInitializedError: If the video device is not initialized.

Implements vpDisplay.

Definition at line 502 of file vpDisplayOpenCV.cpp.

References vpDisplay::displayHasBeenInitialized, vpDisplayException::notInitializedError, vpDisplay::title_, vpERROR_TRACE, vpDisplay::windowXPosition, and vpDisplay::windowYPosition.

void vpDisplay::setWindowPosition ( const vpImage< unsigned char > &  I,
int  winx,
int  winy 
)
staticinherited

Set the window position in the screen.

Parameters
I: Image associated to the display window.
winx,winy: Position of the upper-left window's border in the screen.
Exceptions
vpDisplayException::notInitializedError: If the video device is not initialized.

Definition at line 154 of file vpDisplay.cpp.

References vpImage< Type >::display, vpDisplay::setWindowPosition(), and vpERROR_TRACE.

void vpDisplay::setWindowPosition ( const vpImage< vpRGBa > &  I,
int  winx,
int  winy 
)
staticinherited

Set the window position in the screen.

Parameters
I: Image associated to the display window.
winx,winy: Position of the upper-left window's border in the screen.
Exceptions
vpDisplayException::notInitializedError: If the video device is not initialized.

Definition at line 2323 of file vpDisplay.cpp.

References vpImage< Type >::display, vpDisplay::setWindowPosition(), and vpERROR_TRACE.

Member Data Documentation

bool vpDisplay::displayHasBeenInitialized
protectedinherited

display has been initialized

Definition at line 178 of file vpDisplay.h.

Referenced by vpDisplayX::clearDisplay(), vpDisplayWin32::closeDisplay(), vpDisplayX::closeDisplay(), closeDisplay(), vpDisplayGTK::closeDisplay(), vpDisplayX::displayArrow(), displayArrow(), vpDisplayGTK::displayArrow(), vpDisplayX::displayCharString(), displayCharString(), vpDisplayGTK::displayCharString(), vpDisplayX::displayCircle(), displayCircle(), vpDisplayGTK::displayCircle(), vpDisplayX::displayCross(), displayCross(), vpDisplayGTK::displayCross(), vpDisplayX::displayDotLine(), displayDotLine(), vpDisplayGTK::displayDotLine(), vpDisplayX::displayImage(), displayImage(), vpDisplayGTK::displayImage(), vpDisplayX::displayImageROI(), displayImageROI(), vpDisplayGTK::displayImageROI(), vpDisplayX::displayLine(), displayLine(), vpDisplayGTK::displayLine(), vpDisplayX::displayPoint(), displayPoint(), vpDisplayGTK::displayPoint(), vpDisplayX::displayRectangle(), displayRectangle(), vpDisplayGTK::displayRectangle(), vpDisplayX::flushDisplay(), flushDisplay(), vpDisplayGTK::flushDisplay(), vpDisplayX::flushDisplayROI(), flushDisplayROI(), vpDisplayGTK::flushDisplayROI(), vpDisplayX::getClick(), getClick(), vpDisplayGTK::getClick(), vpDisplayX::getClickUp(), getClickUp(), vpDisplayGTK::getClickUp(), vpDisplayX::getImage(), vpDisplayGTK::getImage(), vpDisplayX::getKeyboardEvent(), vpDisplayGTK::getKeyboardEvent(), getKeyboardEvent(), vpDisplayX::getPointerMotionEvent(), vpDisplayGTK::getPointerMotionEvent(), getPointerMotionEvent(), vpDisplayX::getPointerPosition(), vpDisplayGTK::getPointerPosition(), getPointerPosition(), vpDisplayWin32::init(), vpDisplayX::init(), vpDisplayGTK::init(), init(), vpDisplayX::setFont(), vpDisplayX::setTitle(), vpDisplayGTK::setTitle(), vpDisplayX::setWindowPosition(), setWindowPosition(), vpDisplayGTK::setWindowPosition(), vpDisplay::vpDisplay(), and vpDisplay::~vpDisplay().