Display

class Display

Bases: pybind11_object

Class that defines generic functionalities for display.

The tutorial-getting-started is a good starting point to know how to use this class to display an image in a window.

Warning

Since ViSP 3.3.1 or higher we introduce the alpha channel support for color transparency. This new feature is only supported yet using vpDisplayOpenCV . See vpColor header documentation and displayOpenCV.cpp example for usage when displaying filled transparent circles and rectangles.

The example below shows how to use this class.

#include <visp3/core/vpConfig.h>
#include <visp3/gui/vpDisplayD3D.h>
#include <visp3/gui/vpDisplayGDI.h>
#include <visp3/gui/vpDisplayGTK.h>
#include <visp3/gui/vpDisplayOpenCV.h>
#include <visp3/gui/vpDisplayX.h>
#include <visp3/io/vpImageIo.h>

int main()
{
  vpImage<unsigned char> I; // Grey level image

  // Read an image in PGM P5 format
#ifdef _WIN32
  vpImageIo::read(I, "C:/Temp/visp-images/Klimt/Klimt.pgm");
#else
  vpImageIo::read(I, "/local/soft/ViSP/ViSP-images/Klimt/Klimt.pgm");
#endif

  vpDisplay *d;

  // 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(HAVE_OPENCV_HIGHGUI)
  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

  // Specify the window location
  vpDisplay::setWindowPosition(I, 400, 100);

  // Set the display window title
  vpDisplay::setTitle(I, "My image");

  // To initialize the video device, it is also possible to replace
  // the 3 previous lines by:
  // d->init(I, 400, 100, "My image");

  // Set the display background with image I content
  vpDisplay::display(I);

  // 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(50);
  topLeftCorner.set_j(10);
  vpDisplay::displayRectangle(I, topLeftCorner, 100, 20, vpColor::green,
                              true);

  // Flush the foreground and background display
  vpDisplay::flush(I);

  // Get non blocking keyboard events
  std::cout << "Check keyboard events..." << std::endl;
  char key[10]; sprintf(key, "\0");
  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;
    vpTime::wait(40);
  }

  // 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;
  vpDisplay::getClick(I);

  delete d;
}

Other examples are available in tutorial-image-viewer.cpp and tutorial-viewer.cpp.

Methods

__init__

close

Overloaded function.

computeAutoScale

param width:

Image size.

display

Overloaded function.

displayArrow

Overloaded function.

displayCamera

Overloaded function.

displayCircleStatic

Overloaded function.

displayCross

Overloaded function.

displayDotLine

Overloaded function.

displayEllipse

Overloaded function.

displayFrame

Overloaded function.

displayLine

Overloaded function.

displayPoint

Overloaded function.

displayPolygon

Overloaded function.

displayROI

Overloaded function.

displayRectangle

Overloaded function.

displayText

Overloaded function.

flush

Overloaded function.

flushROI

Overloaded function.

getClick

Overloaded function.

getClickUp

Overloaded function.

getDownScalingFactor

Return the value of the down scale factor applied to the image in order to reduce the size of the window used to display the image.

getHeight

Return the display height.

getImage

Overloaded function.

getImageDownScalingFactor

Overloaded function.

getKeyboardEvent

Overloaded function.

getPointerMotionEvent

Overloaded function.

getPointerPosition

Overloaded function.

getWidth

Return the display width.

getWindowXPosition

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

getWindowYPosition

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

isInitialised

Check if the display has been initialised.

setBackground

Overloaded function.

setDownScalingFactor

Overloaded function.

setFont

Overloaded function.

setTitle

Overloaded function.

setWindowPosition

Overloaded function.

Inherited Methods

Operators

__doc__

__init__

__module__

Attributes

SCALE_1

SCALE_10

SCALE_2

SCALE_3

SCALE_4

SCALE_5

SCALE_6

SCALE_7

SCALE_8

SCALE_9

SCALE_AUTO

SCALE_DEFAULT

__annotations__

class ScaleType(self, value: int)

Bases: pybind11_object

Values that could be applied to a display to down scale the size of the display.

Values:

  • SCALE_AUTO: Auto down scaling factor computed fom the screen resolution.

  • SCALE_1: Display and image have the same size.

  • SCALE_2: Display width and height is down scaled by 2 wrt the image size.

  • SCALE_3: Display width and height is down scaled by 3 wrt the image size.

  • SCALE_4: Display width and height is down scaled by 4 wrt the image size.

  • SCALE_5: Display width and height is down scaled by 5 wrt the image size.

  • SCALE_6: Display width and height is down scaled by 6 wrt the image size.

  • SCALE_7: Display width and height is down scaled by 7 wrt the image size.

  • SCALE_8: Display width and height is down scaled by 8 wrt the image size.

  • SCALE_9: Display width and height is down scaled by 9 wrt the image size.

  • SCALE_10: Display width and height is down scaled by 10 wrt the image size.

  • SCALE_DEFAULT: Display and image have the same size. Similar to vpDisplay::SCALE_1 .

__and__(self, other: object) object
__eq__(self, other: object) bool
__ge__(self, other: object) bool
__getstate__(self) int
__gt__(self, other: object) bool
__hash__(self) int
__index__(self) int
__init__(self, value: int)
__int__(self) int
__invert__(self) object
__le__(self, other: object) bool
__lt__(self, other: object) bool
__ne__(self, other: object) bool
__or__(self, other: object) object
__rand__(self, other: object) object
__ror__(self, other: object) object
__rxor__(self, other: object) object
__setstate__(self, state: int) None
__xor__(self, other: object) object
property name : str
__init__(*args, **kwargs)
static close(*args, **kwargs)

Overloaded function.

  1. close(I: visp._visp.core.ImageGray) -> None

Close the display attached to I.

  1. close(I: visp._visp.core.ImageRGBa) -> None

Close the display attached to I.

computeAutoScale(self, width: int, height: int) int
Parameters:
width: int

Image size.

height: int

Image size.

static display(*args, **kwargs)

Overloaded function.

  1. display(I: visp._visp.core.ImageGray) -> None

Display image I .

Warning

Display has to be initialized.

Warning

Suppress the overlay drawing.

Note

See init() , close()

Parameters:
I

Image to display.

  1. display(I: visp._visp.core.ImageRGBa) -> None

Display image I .

Warning

Display has to be initialized.

Warning

Suppress the overlay drawing.

Note

See init() , close()

Parameters:
I

Image to display.

static displayArrow(*args, **kwargs)

Overloaded function.

  1. displayArrow(I: visp._visp.core.ImageGray, ip1: visp._visp.core.ImagePoint, ip2: visp._visp.core.ImagePoint, color: visp._visp.core.Color = vpColor::white, w: int = 4, h: int = 2, thickness: int = 1) -> None

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

Parameters:
I

The image associated to the display.

ip1

Initial and final image points.

ip2

Initial and final image points.

color

Arrow color.

w

Width and height of the arrow.

h

Width and height of the arrow.

thickness

Thickness of the lines used to display the arrow.

  1. displayArrow(I: visp._visp.core.ImageGray, i1: int, j1: int, i2: int, j2: int, color: visp._visp.core.Color = vpColor::white, w: int = 4, h: int = 2, thickness: int = 1) -> None

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

Parameters:
I

The image associated to the display.

i1

Initial image point.

j1

Initial image point.

i2

Final image point.

j2

Final image point.

color

Arrow color.

w

Width and height of the arrow.

h

Width and height of the arrow.

thickness

Thickness of the lines used to display the arrow.

  1. displayArrow(I: visp._visp.core.ImageRGBa, ip1: visp._visp.core.ImagePoint, ip2: visp._visp.core.ImagePoint, color: visp._visp.core.Color = vpColor::white, w: int = 4, h: int = 2, thickness: int = 1) -> None

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

Parameters:
I

The image associated to the display.

ip1

Initial and final image points.

ip2

Initial and final image points.

color

Arrow color.

w

Width and height of the arrow.

h

Width and height of the arrow.

thickness

Thickness of the lines used to display the arrow.

  1. displayArrow(I: visp._visp.core.ImageRGBa, i1: int, j1: int, i2: int, j2: int, color: visp._visp.core.Color = vpColor::white, w: int = 4, h: int = 2, thickness: int = 1) -> None

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

Parameters:
I

The image associated to the display.

i1

Initial image point.

j1

Initial image point.

i2

Final image point.

j2

Final image point.

color

Arrow color.

w

Width and height of the arrow.

h

Width and height of the arrow.

thickness

Thickness of the lines used to display the arrow.

static displayCamera(*args, **kwargs)

Overloaded function.

  1. displayCamera(I: visp._visp.core.ImageGray, cMo: visp._visp.core.HomogeneousMatrix, cam: visp._visp.core.CameraParameters, size: float, color: visp._visp.core.Color, thickness: int) -> None

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.

  1. displayCamera(I: visp._visp.core.ImageRGBa, cMo: visp._visp.core.HomogeneousMatrix, cam: visp._visp.core.CameraParameters, size: float, color: visp._visp.core.Color, thickness: int) -> None

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.

static displayCircleStatic(*args, **kwargs)

Overloaded function.

  1. displayCircleStatic(I: visp._visp.core.ImageGray, circle: visp._visp.core.ImageCircle, color: visp._visp.core.Color, fill: bool = false, thickness: int = 1) -> None

Display a circle.

Parameters:
I

The image associated to the display.

circle

Circle to display.

color

Circle color.

fill

When set to true fill the circle. When vpDisplayOpenCV is used, and color alpha channel is set, filling feature can handle transparency. See vpColor header class documentation.

thickness

Thickness of the circle. This parameter is only useful when fill is set to false.

  1. displayCircleStatic(I: visp._visp.core.ImageGray, center: visp._visp.core.ImagePoint, radius: int, color: visp._visp.core.Color, fill: bool = false, thickness: int = 1) -> None

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 circle. When vpDisplayOpenCV is used, and color alpha channel is set, filling feature can handle transparency. See vpColor header class documentation.

thickness

Thickness of the circle. This parameter is only useful when fill is set to false.

  1. displayCircleStatic(I: visp._visp.core.ImageGray, i: int, j: int, radius: int, color: visp._visp.core.Color, fill: bool = false, thickness: int = 1) -> None

Display a circle.

Parameters:
I

The image associated to the display.

i

Circle center position.

j

Circle center position.

radius

Circle radius.

color

Circle color.

fill

When set to true fill the circle. When vpDisplayOpenCV is used, and color alpha channel is set, filling feature can handle transparency. See vpColor header class documentation.

thickness

Thickness of the circle. This parameter is only useful when fill is set to false.

  1. displayCircleStatic(I: visp._visp.core.ImageRGBa, circle: visp._visp.core.ImageCircle, color: visp._visp.core.Color, fill: bool = false, thickness: int = 1) -> None

Display a circle.

Parameters:
I

The image associated to the display.

circle

Circle to display.

color

Circle color.

fill

When set to true fill the circle. When vpDisplayOpenCV is used, and color alpha channel is set, filling feature can handle transparency. See vpColor header class documentation.

thickness

Thickness of the circle. This parameter is only useful when fill is set to false.

  1. displayCircleStatic(I: visp._visp.core.ImageRGBa, center: visp._visp.core.ImagePoint, radius: int, color: visp._visp.core.Color, fill: bool = false, thickness: int = 1) -> None

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 circle. When vpDisplayOpenCV is used, and color alpha channel is set, filling feature can handle transparency. See vpColor header class documentation.

thickness

Thickness of the circle. This parameter is only useful when fill is set to false.

  1. displayCircleStatic(I: visp._visp.core.ImageRGBa, i: int, j: int, radius: int, color: visp._visp.core.Color, fill: bool = false, thickness: int = 1) -> None

Display a circle.

Parameters:
I

The image associated to the display.

i

Circle center position.

j

Circle center position.

radius

Circle radius.

color

Circle color.

fill

When set to true fill the circle. When vpDisplayOpenCV is used, and color alpha channel is set, filling feature can handle transparency. See vpColor header class documentation.

thickness

Thickness of the circle. This parameter is only useful when fill is set to false.

static displayCross(*args, **kwargs)

Overloaded function.

  1. displayCross(I: visp._visp.core.ImageGray, ip: visp._visp.core.ImagePoint, size: int, color: visp._visp.core.Color, thickness: int = 1) -> None

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.

  1. displayCross(I: visp._visp.core.ImageGray, i: int, j: int, size: int, color: visp._visp.core.Color, thickness: int = 1) -> None

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

Parameters:
I

The image associated to the display.

i

Cross location.

j

Cross location.

size

Size (width and height) of the cross.

color

Cross color.

thickness

Thickness of the lines used to display the cross.

  1. displayCross(I: visp._visp.core.ImageRGBa, ip: visp._visp.core.ImagePoint, size: int, color: visp._visp.core.Color, thickness: int = 1) -> None

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.

  1. displayCross(I: visp._visp.core.ImageRGBa, i: int, j: int, size: int, color: visp._visp.core.Color, thickness: int = 1) -> None

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

Parameters:
I

The image associated to the display.

i

Cross location.

j

Cross location.

size

Size (width and height) of the cross.

color

Cross color.

thickness

Thickness of the lines used to display the cross.

static displayDotLine(*args, **kwargs)

Overloaded function.

  1. displayDotLine(I: visp._visp.core.ImageGray, ip1: visp._visp.core.ImagePoint, ip2: visp._visp.core.ImagePoint, color: visp._visp.core.Color, thickness: int = 1) -> None

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

Parameters:
I

The image associated to the display.

ip1

Initial and final image points.

ip2

Initial and final image points.

color

Line color.

thickness

Dashed line thickness.

  1. displayDotLine(I: visp._visp.core.ImageGray, i1: int, j1: int, i2: int, j2: int, color: visp._visp.core.Color, thickness: int = 1) -> None

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

Parameters:
I

The image associated to the display.

i1

Initial image point.

j1

Initial image point.

i2

Final image point.

j2

Final image point.

color

Line color.

thickness

Dashed line thickness.

  1. displayDotLine(I: visp._visp.core.ImageGray, ips: list[visp._visp.core.ImagePoint], closeTheShape: bool, color: visp._visp.core.Color, thickness: int = 1) -> None

Display dashed lines for the list of image points.

Parameters:
I

The image associated to the display.

ips

Vector of image points.

closeTheShape

If true, display a dashed line from the first and last image points.

color

Line color.

thickness

Dashed line thickness.

  1. displayDotLine(I: visp._visp.core.ImageGray, ips: list[visp._visp.core.ImagePoint], closeTheShape: bool, color: visp._visp.core.Color, thickness: int = 1) -> None

Display dashed lines for the list of image points.

Parameters:
I

The image associated to the display.

ips

List of image points.

closeTheShape

If true, display a dashed line from the first and last image points.

color

Line color.

thickness

Dashed line thickness.

  1. displayDotLine(I: visp._visp.core.ImageRGBa, ip1: visp._visp.core.ImagePoint, ip2: visp._visp.core.ImagePoint, color: visp._visp.core.Color, thickness: int = 1) -> None

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

Parameters:
I

The image associated to the display.

ip1

Initial and final image points.

ip2

Initial and final image points.

color

Line color.

thickness

Dashed line thickness.

  1. displayDotLine(I: visp._visp.core.ImageRGBa, i1: int, j1: int, i2: int, j2: int, color: visp._visp.core.Color, thickness: int = 1) -> None

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

Parameters:
I

The image associated to the display.

i1

Initial image point.

j1

Initial image point.

i2

Final image point.

j2

Final image point.

color

Line color.

thickness

Dashed line thickness.

  1. displayDotLine(I: visp._visp.core.ImageRGBa, ips: list[visp._visp.core.ImagePoint], closeTheShape: bool, color: visp._visp.core.Color, thickness: int = 1) -> None

Display the dashed lines formed by the list of image points

Parameters:
I

The image associated to the display.

ips

Vector of image points.

closeTheShape

If true, display a dashed line from the first and last image points.

color

Line color.

thickness

Dashed line thickness.

  1. displayDotLine(I: visp._visp.core.ImageRGBa, ips: list[visp._visp.core.ImagePoint], closeTheShape: bool, color: visp._visp.core.Color, thickness: int = 1) -> None

Display the dashed lines formed by the list of image points

Parameters:
I

The image associated to the display.

ips

List of image points.

closeTheShape

If true, display a dashed line from the first and last image points.

color

Line color.

thickness

Dashed line thickness.

static displayEllipse(*args, **kwargs)

Overloaded function.

  1. displayEllipse(I: visp._visp.core.ImageGray, center: visp._visp.core.ImagePoint, coef1: float, coef2: float, coef3: float, use_normalized_centered_moments: bool, color: visp._visp.core.Color, thickness: int = 1, display_center: bool = false, display_arc: bool = false) -> None

Display an ellipse from its parameters expressed in pixels.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_nij()[0], ellipse.get_nij()[1], ellipse.get_nij()[2],
                          true, vpColor::orange, 1);
vpDisplay::flush(I);
Parameters:
I

Image to consider.

center

Center \((u_c, v_c)\) of the ellipse.

coef1

Depending on the parameter use_normalized_centered_moments these parameters are:

  • second order centered moments of the ellipse normalized by its area (i.e., such that \(n_{ij} = \mu_{ij}/a\) where \(\mu_{ij}\) are the centered moments and a the area) expressed in pixels.

  • the major and minor axis length in pixels and the eccentricity of the ellipse in radians: \(a, b, e\) .

coef2

Depending on the parameter use_normalized_centered_moments these parameters are:

  • second order centered moments of the ellipse normalized by its area (i.e., such that \(n_{ij} = \mu_{ij}/a\) where \(\mu_{ij}\) are the centered moments and a the area) expressed in pixels.

  • the major and minor axis length in pixels and the eccentricity of the ellipse in radians: \(a, b, e\) .

coef3

Depending on the parameter use_normalized_centered_moments these parameters are:

  • second order centered moments of the ellipse normalized by its area (i.e., such that \(n_{ij} = \mu_{ij}/a\) where \(\mu_{ij}\) are the centered moments and a the area) expressed in pixels.

  • the major and minor axis length in pixels and the eccentricity of the ellipse in radians: \(a, b, e\) .

use_normalized_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 normalized centered moments \(n_{20}, n_{11}, n_{02}\) expressed in pixels. In that case, we compute the parameters a , b and e from the centered moments.

color

Ellipse color.

thickness

Ellipse thickness.

display_center

Display a cross at the center of the ellipse.

display_arc

Display a line between the center and the first arc extremity and a line between the center and the second arc extremity.

  1. displayEllipse(I: visp._visp.core.ImageGray, center: visp._visp.core.ImagePoint, coef1: float, coef2: float, coef3: float, smallalpha: float, highalpha: float, use_normalized_centered_moments: bool, color: visp._visp.core.Color, thickness: int = 1, display_center: bool = false, display_arc: bool = false) -> None

Display an ellipse from its parameters expressed in pixels.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_nij()[0], ellipse.get_nij()[1], ellipse.get_nij()[2],
                          ellipse.getSmallestAngle(), ellipse.getHighestAngle(),
                          true, vpColor::orange, 1);
vpDisplay::flush(I);
Parameters:
I

Image to consider.

center

Center \((u_c, v_c)\) of the ellipse.

coef1

Depending on the parameter use_normalized_centered_moments these parameters are:

  • second order centered moments of the ellipse normalized by its area (i.e., such that \(n_{ij} = \mu_{ij}/a\) where \(\mu_{ij}\) are the centered moments and a the area) expressed in pixels.

  • the major and minor axis length in pixels and the eccentricity of the ellipse in radians: \(a, b, e\) .

coef2

Depending on the parameter use_normalized_centered_moments these parameters are:

  • second order centered moments of the ellipse normalized by its area (i.e., such that \(n_{ij} = \mu_{ij}/a\) where \(\mu_{ij}\) are the centered moments and a the area) expressed in pixels.

  • the major and minor axis length in pixels and the eccentricity of the ellipse in radians: \(a, b, e\) .

coef3

Depending on the parameter use_normalized_centered_moments these parameters are:

  • second order centered moments of the ellipse normalized by its area (i.e., such that \(n_{ij} = \mu_{ij}/a\) where \(\mu_{ij}\) are the centered moments and a the area) expressed in pixels.

  • the major and minor axis length in pixels and the eccentricity of the ellipse in radians: \(a, b, e\) .

smallalpha

Smallest \(alpha\) angle in rad (0 for a complete ellipse).

highalpha

Highest \(alpha\) angle in rad (2 \(\Pi\) for a complete ellipse).

use_normalized_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 normalized centered moments \(n_{20}, n_{11}, n_{02}\) expressed in pixels. In that case, we compute the parameters a , b and e from the centered moments.

color

Ellipse color.

thickness

Ellipse thickness.

display_center

Display a cross at the center of the ellipse.

display_arc

Display a line between the center and the first arc extremity and a line between the center and the second arc extremity.

  1. displayEllipse(I: visp._visp.core.ImageRGBa, center: visp._visp.core.ImagePoint, coef1: float, coef2: float, coef3: float, use_centered_moments: bool, color: visp._visp.core.Color, thickness: int = 1, display_center: bool = false, display_arc: bool = false) -> None

Display an ellipse from its parameters expressed in pixels.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_nij()[0], ellipse.get_nij()[1], ellipse.get_nij()[2],
                          true, vpColor::orange, 1);
vpDisplay::flush(I);
Parameters:
I

Image to consider.

center

Center \((u_c, v_c)\) of the ellipse.

coef1

Depending on the parameter use_normalized_centered_moments these parameters are:

  • second order centered moments of the ellipse normalized by its area (i.e., such that \(n_{ij} = \mu_{ij}/a\) where \(\mu_{ij}\) are the centered moments and a the area) expressed in pixels.

  • the major and minor axis length in pixels and the eccentricity of the ellipse in radians: \(a, b, e\) .

coef2

Depending on the parameter use_normalized_centered_moments these parameters are:

  • second order centered moments of the ellipse normalized by its area (i.e., such that \(n_{ij} = \mu_{ij}/a\) where \(\mu_{ij}\) are the centered moments and a the area) expressed in pixels.

  • the major and minor axis length in pixels and the eccentricity of the ellipse in radians: \(a, b, e\) .

coef3

Depending on the parameter use_normalized_centered_moments these parameters are:

  • second order centered moments of the ellipse normalized by its area (i.e., such that \(n_{ij} = \mu_{ij}/a\) where \(\mu_{ij}\) are the centered moments and a the area) expressed in pixels.

  • the major and minor axis length in pixels and the eccentricity of the ellipse in radians: \(a, b, e\) .

color

Ellipse color.

thickness

Ellipse thickness.

display_center

Display a cross at the center of the ellipse.

display_arc

Display a line between the center and the first arc extremity and a line between the center and the second arc extremity.

  1. displayEllipse(I: visp._visp.core.ImageRGBa, center: visp._visp.core.ImagePoint, coef1: float, coef2: float, coef3: float, theta1: float, theta2: float, use_centered_moments: bool, color: visp._visp.core.Color, thickness: int = 1, display_center: bool = false, display_arc: bool = false) -> None

Display an ellipse from its parameters expressed in pixels.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_nij()[0], ellipse.get_nij()[1], ellipse.get_nij()[2],
                          ellipse.getSmallestAngle(), ellipse.getHighestAngle(),
                          true, vpColor::orange, 1);
vpDisplay::flush(I);
Parameters:
I

Image to consider.

center

Center \((u_c, v_c)\) of the ellipse.

coef1

Depending on the parameter use_normalized_centered_moments these parameters are:

  • second order centered moments of the ellipse normalized by its area (i.e., such that \(n_{ij} = \mu_{ij}/a\) where \(\mu_{ij}\) are the centered moments and a the area) expressed in pixels.

  • the major and minor axis length in pixels and the eccentricity of the ellipse in radians: \(a, b, e\) .

coef2

Depending on the parameter use_normalized_centered_moments these parameters are:

  • second order centered moments of the ellipse normalized by its area (i.e., such that \(n_{ij} = \mu_{ij}/a\) where \(\mu_{ij}\) are the centered moments and a the area) expressed in pixels.

  • the major and minor axis length in pixels and the eccentricity of the ellipse in radians: \(a, b, e\) .

coef3

Depending on the parameter use_normalized_centered_moments these parameters are:

  • second order centered moments of the ellipse normalized by its area (i.e., such that \(n_{ij} = \mu_{ij}/a\) where \(\mu_{ij}\) are the centered moments and a the area) expressed in pixels.

  • the major and minor axis length in pixels and the eccentricity of the ellipse in radians: \(a, b, e\) .

color

Ellipse color.

thickness

Ellipse thickness.

display_center

Display a cross at the center of the ellipse.

display_arc

Display a line between the center and the first arc extremity and a line between the center and the second arc extremity.

static displayFrame(*args, **kwargs)

Overloaded function.

  1. displayFrame(I: visp._visp.core.ImageGray, cMo: visp._visp.core.HomogeneousMatrix, cam: visp._visp.core.CameraParameters, size: float, color: visp._visp.core.Color = vpColor::none, thickness: int = 1, offset: visp._visp.core.ImagePoint = vpImagePoint(0,0), frameName: str = , textColor: visp._visp.core.Color = vpColor::black, textOffset: visp._visp.core.ImagePoint = vpImagePoint(15,15)) -> None

Display the projection of an object frame represented by 3 arrows in the image. Red, green and blue arrows correspond to frame X, Y and Z axis respectively.

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.

offset

Offset in pixels applied to the frame origin location in the image.

frameName

Text to display along side the origin of the frame.

textColor

Color of the text associated to frameName .

textOffset

Offset used to shift the text from the origin of the frame.

  1. displayFrame(I: visp._visp.core.ImageRGBa, cMo: visp._visp.core.HomogeneousMatrix, cam: visp._visp.core.CameraParameters, size: float, color: visp._visp.core.Color = vpColor::none, thickness: int = 1, offset: visp._visp.core.ImagePoint = vpImagePoint(0,0), frameName: str = , textColor: visp._visp.core.Color = vpColor::black, textOffset: visp._visp.core.ImagePoint = vpImagePoint(15,15)) -> None

Display the projection of an object frame represented by 3 arrows in the image. Red, green and blue arrows correspond to frame X, Y and Z axis respectively.

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.

offset

Offset in pixels applied to the frame origin location in the image.

frameName

Text to display along side the origin of the frame.

textColor

Color of the text associated to frameName .

textOffset

Offset used to shift the text from the origin of the frame.

static displayLine(*args, **kwargs)

Overloaded function.

  1. displayLine(I: visp._visp.core.ImageGray, ip1: visp._visp.core.ImagePoint, ip2: visp._visp.core.ImagePoint, color: visp._visp.core.Color, thickness: int = 1, segment: bool = true) -> None

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

Parameters:
I

The image associated to the display.

ip1

Initial and final image points.

ip2

Initial and final image points.

color

Line color.

thickness

Line thickness.

segment

If true (default) display the segment between the two image points. If false, display the line passing through the two image points.

  1. displayLine(I: visp._visp.core.ImageGray, i1: int, j1: int, i2: int, j2: int, color: visp._visp.core.Color, thickness: int = 1, segment: bool = true) -> None

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

Parameters:
I

The image associated to the display.

i1

Initial image point.

j1

Initial image point.

i2

Final image point.

j2

Final image point.

color

Line color.

thickness

Line thickness.

segment

If true (default) display the segment between the two image points. If false, display the line passing through the two image points.

  1. displayLine(I: visp._visp.core.ImageGray, ips: list[visp._visp.core.ImagePoint], closeTheShape: bool, color: visp._visp.core.Color, thickness: int = 1) -> None

Display the lines formed by the list of image points.

Parameters:
I

The image associated to the display.

ips

Vector of image points.

closeTheShape

If true, display a line from the first and last image points.

color

Line color.

thickness

Line thickness.

  1. displayLine(I: visp._visp.core.ImageGray, ips: list[visp._visp.core.ImagePoint], closeTheShape: bool, color: visp._visp.core.Color, thickness: int = 1) -> None

Display the lines formed by the list of image points.

Parameters:
I

The image associated to the display.

ips

List of image points.

closeTheShape

If true, display a line from the first and last image points.

color

Line color.

thickness

Line thickness.

  1. displayLine(I: visp._visp.core.ImageRGBa, ip1: visp._visp.core.ImagePoint, ip2: visp._visp.core.ImagePoint, color: visp._visp.core.Color, thickness: int = 1, segment: bool = true) -> None

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

Parameters:
I

The image associated to the display.

ip1

Initial and final image points.

ip2

Initial and final image points.

color

Line color.

thickness

Line thickness.

segment

If true (default) display the segment between the two image points. If false, display the line passing through the two image points.

  1. displayLine(I: visp._visp.core.ImageRGBa, i1: int, j1: int, i2: int, j2: int, color: visp._visp.core.Color, thickness: int = 1, segment: bool = true) -> None

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

Parameters:
I

The image associated to the display.

i1

Initial image point.

j1

Initial image point.

i2

Final image point.

j2

Final image point.

color

Line color.

thickness

Line thickness.

segment

If true (default) display the segment between the two image points. If false, display the line passing through the two image points.

  1. displayLine(I: visp._visp.core.ImageRGBa, ips: list[visp._visp.core.ImagePoint], closeTheShape: bool, color: visp._visp.core.Color, thickness: int = 1) -> None

Display the lines formed by the list of image points.

Parameters:
I

The image associated to the display.

ips

Vector of image points.

closeTheShape

If true, draw a line from the first and last image points.

color

Line color.

thickness

Line thickness.

  1. displayLine(I: visp._visp.core.ImageRGBa, ips: list[visp._visp.core.ImagePoint], closeTheShape: bool, color: visp._visp.core.Color, thickness: int = 1) -> None

Display the lines formed by the list of image points.

Parameters:
I

The image associated to the display.

ips

List of image points.

closeTheShape

If true, draw a line from the first and last image points.

color

Line color.

thickness

Line thickness.

static displayPoint(*args, **kwargs)

Overloaded function.

  1. displayPoint(I: visp._visp.core.ImageGray, ip: visp._visp.core.ImagePoint, color: visp._visp.core.Color, thickness: int = 1) -> None

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

  1. displayPoint(I: visp._visp.core.ImageGray, i: int, j: int, color: visp._visp.core.Color, thickness: int = 1) -> None

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

Parameters:
I

The image associated to the display.

i

Point location.

j

Point location.

color

Point color.

thickness

Thickness of the point

  1. displayPoint(I: visp._visp.core.ImageRGBa, ip: visp._visp.core.ImagePoint, color: visp._visp.core.Color, thickness: int = 1) -> None

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

  1. displayPoint(I: visp._visp.core.ImageRGBa, i: int, j: int, color: visp._visp.core.Color, thickness: int = 1) -> None

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

Parameters:
I

The image associated to the display.

i

Point location.

j

Point location.

color

Point color.

thickness

Thickness of the point

static displayPolygon(*args, **kwargs)

Overloaded function.

  1. displayPolygon(I: visp._visp.core.ImageGray, vip: list[visp._visp.core.ImagePoint], color: visp._visp.core.Color, thickness: int = 1, closed: bool = true) -> None

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.

closed

When true display a closed polygon with a segment between first and last image point.

  1. displayPolygon(I: visp._visp.core.ImageGray, polygon: visp._visp.core.Polygon, color: visp._visp.core.Color, thickness: int = 1, closed: bool = true) -> None

Display a polygon defined by a set of image points.

Parameters:
I

The image associated to the display.

polygon

Polygon to display.

color

Line color.

thickness

Line thickness.

closed

When true display a closed polygon with a segment between first and last image point.

  1. displayPolygon(I: visp._visp.core.ImageRGBa, vip: list[visp._visp.core.ImagePoint], color: visp._visp.core.Color, thickness: int = 1, closed: bool = true) -> None

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.

closed

When true display a closed polygon with a segment between first and last image point.

  1. displayPolygon(I: visp._visp.core.ImageRGBa, polygon: visp._visp.core.Polygon, color: visp._visp.core.Color, thickness: int = 1, closed: bool = true) -> None

Display a polygon defined by a set of image points.

Parameters:
I

The image associated to the display.

polygon

Polygon to display.

color

Line color.

thickness

Line thickness.

closed

When true display a closed polygon with a segment between first and last image point.

static displayROI(*args, **kwargs)

Overloaded function.

  1. displayROI(I: visp._visp.core.ImageGray, roi: visp._visp.core.Rect) -> None

Update the display with the content of the image that is in the region of interest.

Parameters:
I

Image.

roi

Region of interest.

  1. displayROI(I: visp._visp.core.ImageRGBa, roi: visp._visp.core.Rect) -> None

Update the display with the content of the image that is in the region of interest.

Parameters:
I

Image.

roi

Region of interest.

static displayRectangle(*args, **kwargs)

Overloaded function.

  1. displayRectangle(I: visp._visp.core.ImageGray, topLeft: visp._visp.core.ImagePoint, width: int, height: int, color: visp._visp.core.Color, fill: bool = false, thickness: int = 1) -> None

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

Rectangle size.

height

Rectangle size.

color

Rectangle color.

fill

When set to true fill the rectangle. When vpDisplayOpenCV is used, and color alpha channel is set, filling feature can handle transparency. See vpColor header class documentation.

thickness

Thickness of the four lines used to display the rectangle. This parameter is only useful when fill is set to false.

  1. displayRectangle(I: visp._visp.core.ImageGray, topLeft: visp._visp.core.ImagePoint, bottomRight: visp._visp.core.ImagePoint, color: visp._visp.core.Color, fill: bool = false, thickness: int = 1) -> None

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. When vpDisplayOpenCV is used, and color alpha channel is set, filling feature can handle transparency. See vpColor header class documentation.

thickness

Thickness of the four lines used to display the rectangle. This parameter is only useful when fill is set to false.

  1. displayRectangle(I: visp._visp.core.ImageGray, rectangle: visp._visp.core.Rect, color: visp._visp.core.Color, fill: bool = false, thickness: int = 1) -> None

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. When vpDisplayOpenCV is used, and color alpha channel is set, filling feature can handle transparency. See vpColor header class documentation.

thickness

Thickness of the four lines used to display the rectangle. This parameter is only useful when fill is set to false.

  1. displayRectangle(I: visp._visp.core.ImageGray, center: visp._visp.core.ImagePoint, angle: float, width: int, height: int, color: visp._visp.core.Color, thickness: int = 1) -> None

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

Rectangle size.

height

Rectangle size.

color

Rectangle color.

thickness

Thickness of the four lines used to display the rectangle.

  1. displayRectangle(I: visp._visp.core.ImageGray, i: int, j: int, width: int, height: int, color: visp._visp.core.Color, fill: bool = false, thickness: int = 1) -> None

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

Top-left corner of the rectangle.

j

Top-left corner of the rectangle.

width

Rectangle size.

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.

  1. displayRectangle(I: visp._visp.core.ImageGray, i: int, j: int, angle: float, width: int, height: int, color: visp._visp.core.Color, thickness: int = 1) -> None

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

Parameters:
I

Image associated to the display.

i

Rectangle center point.

j

Rectangle center point.

angle

Angle in radians width an horizontal axis oriented from left to right.

width

Rectangle size.

height

Rectangle size.

color

Rectangle color.

thickness

Thickness of the four lines used to display the rectangle.

  1. displayRectangle(I: visp._visp.core.ImageRGBa, topLeft: visp._visp.core.ImagePoint, width: int, height: int, color: visp._visp.core.Color, fill: bool = false, thickness: int = 1) -> None

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

Rectangle size.

height

Rectangle size.

color

Rectangle color.

fill

When set to true fill the rectangle. When vpDisplayOpenCV is used, and color alpha channel is set, filling feature can handle transparency. See vpColor header class documentation.

thickness

Thickness of the four lines used to display the rectangle. This parameter is only useful when fill is set to false.

  1. displayRectangle(I: visp._visp.core.ImageRGBa, topLeft: visp._visp.core.ImagePoint, bottomRight: visp._visp.core.ImagePoint, color: visp._visp.core.Color, fill: bool = false, thickness: int = 1) -> None

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. When vpDisplayOpenCV is used, and color alpha channel is set, filling feature can handle transparency. See vpColor header class documentation.

thickness

Thickness of the four lines used to display the rectangle. This parameter is only useful when fill is set to false.

  1. displayRectangle(I: visp._visp.core.ImageRGBa, rectangle: visp._visp.core.Rect, color: visp._visp.core.Color, fill: bool = false, thickness: int = 1) -> None

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. When vpDisplayOpenCV is used, and color alpha channel is set, filling feature can handle transparency. See vpColor header class documentation.

thickness

Thickness of the four lines used to display the rectangle. This parameter is only useful when fill is set to false.

  1. displayRectangle(I: visp._visp.core.ImageRGBa, center: visp._visp.core.ImagePoint, angle: float, width: int, height: int, color: visp._visp.core.Color, thickness: int = 1) -> None

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

Rectangle size.

height

Rectangle size.

color

Rectangle color.

thickness

Thickness of the four lines used to display the rectangle.

  1. displayRectangle(I: visp._visp.core.ImageRGBa, i: int, j: int, width: int, height: int, color: visp._visp.core.Color, fill: bool = false, thickness: int = 1) -> None

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

Top-left corner of the rectangle.

j

Top-left corner of the rectangle.

width

Rectangle size.

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.

  1. displayRectangle(I: visp._visp.core.ImageRGBa, i: int, j: int, angle: float, width: int, height: int, color: visp._visp.core.Color, thickness: int = 1) -> None

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

Parameters:
I

Image associated to the display.

i

Rectangle center point.

j

Rectangle center point.

angle

Angle in radians width an horizontal axis oriented from left to right.

width

Rectangle size.

height

Rectangle size.

color

Rectangle color.

thickness

Thickness of the four lines used to display the rectangle.

static displayText(*args, **kwargs)

Overloaded function.

  1. displayText(I: visp._visp.core.ImageGray, ip: visp._visp.core.ImagePoint, s: str, color: visp._visp.core.Color) -> None

Display a string at the image point ip location.

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

Note

See 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.

  1. displayText(I: visp._visp.core.ImageGray, i: int, j: int, s: str, color: visp._visp.core.Color) -> None

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

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

Note

See setFont()

Parameters:
I

Image associated to the display.

i

Upper left image point location of the string in the display.

j

Upper left image point location of the string in the display.

s

String to display in overlay.

color

String color.

  1. displayText(I: visp._visp.core.ImageRGBa, ip: visp._visp.core.ImagePoint, s: str, color: visp._visp.core.Color) -> None

Display a string at the image point ip location.

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

Note

See 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.

  1. displayText(I: visp._visp.core.ImageRGBa, i: int, j: int, s: str, color: visp._visp.core.Color) -> None

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

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

Note

See setFont()

Parameters:
I

Image associated to the display.

i

Upper left image point location of the string in the display.

j

Upper left image point location of the string in the display.

s

String to display in overlay.

color

String color.

static flush(*args, **kwargs)

Overloaded function.

  1. flush(I: visp._visp.core.ImageGray) -> None

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 <visp3/core/vpColor.h>
#include <visp3/core/vpDisplay.h>
#include <visp3/core/vpImage.h>
#include <visp3/core/vpImagePoint.h>
#include <visp3/gui/vpDisplayGDI.h>

int main() {
  vpImage<unsigned char> I(240, 380);
  vpDisplayGDI d;
  d.init(I);
  vpDisplay::display(I); // display the image
  vpImagePoint center;
  unsigned int radius = 100;
  vpDisplay::displayCircle(I, center, radius, vpColor::red);

  vpDisplay::flush(I); // Mandatory to display the requested features.
}

Note

See flushROI()

  1. flush(I: visp._visp.core.ImageRGBa) -> None

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 <visp3/core/vpColor.h>
#include <visp3/core/vpDisplay.h>
#include <visp3/core/vpImage.h>
#include <visp3/core/vpImagePoint.h>
#include <visp3/gui/vpDisplayGDI.h>

int main() {
  vpImage<vpRGBa> I(240, 380);
  vpDisplayGDI d;
  d.init(I);
  vpDisplay::display(I); // display the image
  vpImagePoint center;
  unsigned int radius = 100;
  vpDisplay::displayCircle(I, center, radius, vpColor::red);

  vpDisplay::flush(I); // Mandatory to display the requested features.
}

Note

See flushROI()

static flushROI(*args, **kwargs)

Overloaded function.

  1. flushROI(I: visp._visp.core.ImageGray, roi: visp._visp.core.Rect) -> None

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.

Note

See flush()

  1. flushROI(I: visp._visp.core.ImageRGBa, roi: visp._visp.core.Rect) -> None

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 parsimoniously.

Note

See flush()

static getClick(*args, **kwargs)

Overloaded function.

  1. getClick(I: visp._visp.core.ImageGray, blocking: bool = true) -> bool

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 .

  1. getClick(I: visp._visp.core.ImageGray, ip: visp._visp.core.ImagePoint, blocking: bool = true) -> bool

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 .

  1. getClick(I: visp._visp.core.ImageGray, ip: visp._visp.core.ImagePoint, button: visp._visp.core.MouseButton.MouseButtonType, blocking: bool = true) -> bool

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 .

  1. getClick(I: visp._visp.core.ImageGray, button: visp._visp.core.MouseButton.MouseButtonType, blocking: bool = true) -> bool

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.

  1. getClick(I: visp._visp.core.ImageRGBa, blocking: bool = true) -> bool

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 .

  1. getClick(I: visp._visp.core.ImageRGBa, ip: visp._visp.core.ImagePoint, blocking: bool = true) -> bool

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 .

  1. getClick(I: visp._visp.core.ImageRGBa, ip: visp._visp.core.ImagePoint, button: visp._visp.core.MouseButton.MouseButtonType, blocking: bool = true) -> bool

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 .

  1. getClick(I: visp._visp.core.ImageRGBa, button: visp._visp.core.MouseButton.MouseButtonType, blocking: bool = true) -> bool

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.

static getClickUp(*args, **kwargs)

Overloaded function.

  1. getClickUp(I: visp._visp.core.ImageGray, ip: visp._visp.core.ImagePoint, button: visp._visp.core.MouseButton.MouseButtonType, blocking: bool = true) -> bool

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 .

  1. getClickUp(I: visp._visp.core.ImageGray, button: visp._visp.core.MouseButton.MouseButtonType, blocking: bool = true) -> bool

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.

  1. getClickUp(I: visp._visp.core.ImageRGBa, ip: visp._visp.core.ImagePoint, button: visp._visp.core.MouseButton.MouseButtonType, blocking: bool = true) -> bool

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 .

  1. getClickUp(I: visp._visp.core.ImageRGBa, button: visp._visp.core.MouseButton.MouseButtonType, blocking: bool = true) -> bool

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.

getDownScalingFactor(self) int

Return the value of the down scale factor applied to the image in order to reduce the size of the window used to display the image.

getHeight(self) int

Return the display height.

Note

See getWidth()

static getImage(*args, **kwargs)

Overloaded function.

  1. getImage(Is: visp._visp.core.ImageGray, Id: visp._visp.core.ImageRGBa) -> None

Get the window pixmap and put it in vpRGBa image.

The code below shows how to use this method.

#include <visp3/core/vpConfig.h>
#include <visp3/gui/vpDisplayD3D.h>
#include <visp3/gui/vpDisplayGDI.h>
#include <visp3/gui/vpDisplayGTK.h>
#include <visp3/gui/vpDisplayOpenCV.h>
#include <visp3/gui/vpDisplayX.h>
#include <visp3/io/vpImageIo.h>

int main()
{
  vpImage<unsigned char> I(240, 320); // Create a black grey level image
  vpImage<vpRGBa> Ioverlay;

  vpDisplay *d;

  // 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(HAVE_OPENCV_HIGHGUI)
  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
  vpDisplay::display(I);

  // 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
  vpDisplay::flush(I);

  // 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
  vpDisplay::getClick(I);

#ifdef VISP_HAVE_DISPLAY
  delete d;
#endif
}
  1. getImage(Is: visp._visp.core.ImageRGBa, Id: visp._visp.core.ImageRGBa) -> None

Get the window pixmap and put it in vpRGBa image.

The code below shows how to use this method.

#include <visp3/gui/vpDisplayD3D.h>
#include <visp3/gui/vpDisplayGDI.h>
#include <visp3/gui/vpDisplayGTK.h>
#include <visp3/gui/vpDisplayOpenCV.h>
#include <visp3/gui/vpDisplayX.h>
#include <visp3/io/vpImageIo.h>

int main()
{
  vpImage<vpRGBa> I(240, 320); // Create a black RGB color image
  vpImage<vpRGBa> Ioverlay;

  vpDisplay *d;

  // 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(HAVE_OPENCV_HIGHGUI)
  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
  vpDisplay::display(I);

  // 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
  vpDisplay::flush(I);

  // 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
  vpDisplay::getClick(I);

#ifdef VISP_HAVE_DISPLAY
  delete d;
#endif
}
static getImageDownScalingFactor(*args, **kwargs)

Overloaded function.

  1. getImageDownScalingFactor(I: visp._visp.core.ImageGray) -> int

Return the value of the down scale factor applied to the image in order to reduce the size of the window used to display the image. When display is not initialized, returns 1.

Parameters:
I

Image associated to the display window.

  1. getImageDownScalingFactor(I: visp._visp.core.ImageRGBa) -> int

Return the value of the down scale factor applied to the image in order to reduce the size of the window used to display the image. When display is not initialized, returns 1.

Parameters:
I

Image associated to the display window.

static getKeyboardEvent(*args, **kwargs)

Overloaded function.

  1. getKeyboardEvent(I: visp._visp.core.ImageGray, blocking: bool = true) -> bool

Get a keyboard event.

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

#include <visp3/core/vpConfig.h>
#include <visp3/gui/vpDisplayD3D.h>
#include <visp3/gui/vpDisplayGDI.h>
#include <visp3/gui/vpDisplayGTK.h>
#include <visp3/gui/vpDisplayOpenCV.h>
#include <visp3/gui/vpDisplayX.h>

int main()
{
  vpImage<unsigned char> I(240, 320); // Create a black image

  vpDisplay *d;

#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(HAVE_OPENCV_HIGHGUI)
  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
  vpDisplay::display(I);

  // Flush the foreground and background display
  vpDisplay::flush(I);

  // Wait for keyboard event
  std::cout << "Waiting a keyboard event..." << std::endl;
  vpDisplay::getKeyboardEvent(I, true);
  std::cout << "A keyboard event was detected" << std::endl;

  // Non blocking keyboard event loop
  int cpt_event = 0;
  std::cout << "Enter a non blocking keyboard event detection loop..." << std::endl;
  do {
    bool event = vpDisplay::getKeyboardEvent(I, false);
    if (event) {
      std::cout << "A keyboard event was detected" << std::endl;
      cpt_event ++;
    }

    vpTime::wait(5); // wait 5 ms
  } while(cpt_event < 5);

#ifdef VISP_HAVE_DISPLAY
  delete d;
#endif
}
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 .

  1. getKeyboardEvent(I: visp._visp.core.ImageGray, blocking: bool = true) -> tuple[bool, str]

Get a keyboard event.

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

#include <visp3/gui/vpDisplayD3D.h>
#include <visp3/gui/vpDisplayGDI.h>
#include <visp3/gui/vpDisplayGTK.h>
#include <visp3/gui/vpDisplayOpenCV.h>
#include <visp3/gui/vpDisplayX.h>

int main()
{
  vpImage<unsigned char> I(240, 320); // Create a black image

  vpDisplay *d;

#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(HAVE_OPENCV_HIGHGUI)
  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
  vpDisplay::display(I);

  // Flush the foreground and background display
  vpDisplay::flush(I);

  // Wait for keyboard event
  std::cout << "Waiting a keyboard event..." << std::endl;
  vpDisplay::getKeyboardEvent(I, true);
  std::cout << "A keyboard event was detected" << std::endl;

  // Non blocking keyboard event loop
  int cpt_event = 0;
  std::string key;
  std::cout << "Enter a non blocking keyboard event detection loop..." << std::endl;
  do {
    bool event = vpDisplay::getKeyboardEvent(I, key, 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
}
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:

A tuple containing:

  • 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 .

    • key: [out]: If possible, an ISO Latin-1 character corresponding to the keyboard key.

  1. getKeyboardEvent(I: visp._visp.core.ImageRGBa, blocking: bool = true) -> bool

Get a keyboard event.

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

#include <visp3/core/vpConfig.h>
#include <visp3/gui/vpDisplayD3D.h>
#include <visp3/gui/vpDisplayGDI.h>
#include <visp3/gui/vpDisplayGTK.h>
#include <visp3/gui/vpDisplayOpenCV.h>
#include <visp3/gui/vpDisplayX.h>

int main()
{
  vpImage<vpRGBa> I(240, 320); // Create a black image

  vpDisplay *d;

#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(HAVE_OPENCV_HIGHGUI)
  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
  vpDisplay::display(I);

  // Flush the foreground and background display
  vpDisplay::flush(I);

  // Wait for keyboard event
  std::cout << "Waiting a keyboard event..." << std::endl;
  vpDisplay::getKeyboardEvent(I, true);
  std::cout << "A keyboard event was detected" << std::endl;

  // Non blocking keyboard event loop
  int cpt_event = 0;
  std::cout << "Enter a non blocking keyboard event detection loop..." << std::endl;
  do {
    bool event = vpDisplay::getKeyboardEvent(I, false);
    if (event) {
      std::cout << "A keyboard event was detected" << std::endl; cpt_event ++;
    }

    vpTime::wait(5); // wait 5 ms
  } while(cpt_event < 5);

#ifdef VISP_HAVE_DISPLAY
  delete d;
#endif
}
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 .

  1. getKeyboardEvent(I: visp._visp.core.ImageRGBa, blocking: bool = true) -> tuple[bool, str]

Get a keyboard event.

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

#include <visp3/gui/vpDisplayD3D.h>
#include <visp3/gui/vpDisplayGDI.h>
#include <visp3/gui/vpDisplayGTK.h>
#include <visp3/gui/vpDisplayOpenCV.h>
#include <visp3/gui/vpDisplayX.h>

int main()
{
  vpImage<vpRGBa> I(240, 320); // Create a black image

  vpDisplay *d;

#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(HAVE_OPENCV_HIGHGUI)
  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
  vpDisplay::display(I);

  // Flush the foreground and background display
  vpDisplay::flush(I);

  // Wait for keyboard event
  std::cout << "Waiting a keyboard event..." << std::endl;
  vpDisplay::getKeyboardEvent(I, true);
  std::cout << "A keyboard event was detected" << std::endl;

  // Non blocking keyboard event loop
  int cpt_event = 0;
  std::string key;
  std::cout << "Enter a non blocking keyboard event detection loop..." << std::endl;
  do {
    bool event = vpDisplay::getKeyboardEvent(I, key, 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
}
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:

A tuple containing:

  • 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 .

    • key: [out]: If possible, an ISO Latin-1 character corresponding to the keyboard key.

static getPointerMotionEvent(*args, **kwargs)

Overloaded function.

  1. getPointerMotionEvent(I: visp._visp.core.ImageGray, ip: visp._visp.core.ImagePoint) -> bool

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.

  1. getPointerMotionEvent(I: visp._visp.core.ImageRGBa, ip: visp._visp.core.ImagePoint) -> bool

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.

static getPointerPosition(*args, **kwargs)

Overloaded function.

  1. getPointerPosition(I: visp._visp.core.ImageGray, ip: visp._visp.core.ImagePoint) -> bool

Get the coordinates of the mouse pointer.

Parameters:
I

[in] : The displayed image.

ip

[out] : The coordinates of the mouse pointer.

Returns:

true.

  1. getPointerPosition(I: visp._visp.core.ImageRGBa, ip: visp._visp.core.ImagePoint) -> bool

Get the coordinates of the mouse pointer.

Parameters:
I

[in] : The displayed image.

ip

[out] : The coordinates of the mouse pointer.

Returns:

true.

getWidth(self) int

Return the display width.

Note

See getHeight()

getWindowXPosition(self) int

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

Note

See getWindowYPosition()

getWindowYPosition(self) int

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

Note

See getWindowXPosition()

isInitialised(self) bool

Check if the display has been initialised.

Returns:

True if the display has been initialised, otherwise False

static setBackground(*args, **kwargs)

Overloaded function.

  1. setBackground(I: visp._visp.core.ImageGray, color: visp._visp.core.Color) -> None

Set the window background.

Parameters:
I

Image associated to the display window.

color

Background color.

  1. setBackground(I: visp._visp.core.ImageRGBa, color: visp._visp.core.Color) -> None

Set the window background.

Parameters:
I

Image associated to the display window.

color

Background color.

setDownScalingFactor(*args, **kwargs)

Overloaded function.

  1. setDownScalingFactor(self: visp._visp.core.Display, scale: int) -> None

Set the down scale factor applied to the image in order to reduce the display size.

Parameters:
scale

Scale factor applied to display a rescaled image.

  1. setDownScalingFactor(self: visp._visp.core.Display, scaleType: visp._visp.core.Display.ScaleType) -> None

Set the down scaling factor either in auto mode or set manually.

This method has to be called before display initialization.

#include <visp3/gui/vpDisplayGDI.h>
#include <visp3/gui/vpDisplayX.h>

int main()
{
  vpImage<unsigned char> I(480, 640); // Black 640 by 480 image
#ifdef VISP_HAVE_X11
  vpDisplayX d;
#elif defined(VISP_HAVE_GDI)
  vpDisplayGDI d;
#endif
  // Display in a 160 by 120 windows size
  d.setDownScalingFactor(vpDisplay::SCALE_4);
  d.init(I);
  vpDisplay::display(I);
  vpDisplay::flush(I);
  vpDisplay::getClick(I); // wait for a click to quit
}
static setFont(*args, **kwargs)

Overloaded function.

  1. setFont(I: visp._visp.core.ImageGray, font: str) -> None

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

Note

Under UNIX, the available fonts are given by the “xlsfonts” binary. To choose a font you can also use the “xfontsel” binary.

Note

See displayText()

Parameters:
I

Image associated to the display window.

  1. setFont(I: visp._visp.core.ImageRGBa, font: str) -> None

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

Note

Under UNIX, the available fonts are given by the “xlsfonts” binary. To choose a font you can also use the “xfontsel” binary.

Note

See displayText()

Parameters:
I

Image associated to the display window.

static setTitle(*args, **kwargs)

Overloaded function.

  1. setTitle(I: visp._visp.core.ImageGray, windowtitle: str) -> None

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.

  1. setTitle(I: visp._visp.core.ImageRGBa, windowtitle: str) -> None

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.

static setWindowPosition(*args, **kwargs)

Overloaded function.

  1. setWindowPosition(I: visp._visp.core.ImageGray, winx: int, winy: int) -> None

Set the window position in the screen.

Parameters:
I

Image associated to the display window.

winx

Position of the upper-left window’s border in the screen.

winy

Position of the upper-left window’s border in the screen.

  1. setWindowPosition(I: visp._visp.core.ImageRGBa, winx: int, winy: int) -> None

Set the window position in the screen.

Parameters:
I

Image associated to the display window.

winx

Position of the upper-left window’s border in the screen.

winy

Position of the upper-left window’s border in the screen.