DisplayOpenCV

class DisplayOpenCV(*args, **kwargs)

Bases: Display

The vpDisplayOpenCV allows to display image using the OpenCV library. Thus to enable this class OpenCV should be installed. Installation instructions are provided here https://visp.inria.fr/3rd_opencv .

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 displaying filled transparent circles and rectangles.

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

#include <visp3/core/vpImagePoint.h>
#include <visp3/gui/vpDisplayOpenCV.h>
#include <visp3/io/vpImageIo.h>

#ifdef ENABLE_VISP_NAMESPACE
using namespace VISP_NAMESPACE_NAME;
#endif

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");

  vpDisplayOpenCV d;

  // Initialize the display with the image I. Display and image are
  // now link together.
  d.init(I);

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

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

  // 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(10);
  topLeftCorner.set_j(50);
  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];
  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);
#endif
}

Overloaded function.

  1. __init__(self: visp._visp.gui.DisplayOpenCV) -> None

Basic constructor.

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

#include <visp3/core/vpImage.h>
#include <visp3/gui/vpDisplayOpenCV.h>

#ifdef ENABLE_VISP_NAMESPACE
using namespace VISP_NAMESPACE_NAME;
#endif

int main()
{
  vpDisplayOpenCV d;
  vpImage<unsigned char> I(240, 384);
  d.init(I, 100, 200, "My display");
}
  1. __init__(self: visp._visp.gui.DisplayOpenCV, winx: int, winy: int, title: str = ) -> None

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

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

#include <visp3/core/vpImage.h>
#include <visp3/gui/vpDisplayOpenCV.h>

#ifdef ENABLE_VISP_NAMESPACE
using namespace VISP_NAMESPACE_NAME;
#endif

int main()
{
  vpDisplayOpenCV d(100, 200, "My display");
  vpImage<unsigned char> I(240, 384);
  d.init(I);
}
Parameters:
title

Window title.

  1. __init__(self: visp._visp.gui.DisplayOpenCV, I: visp._visp.core.ImageGray, type: visp._visp.core.Display.ScaleType) -> None

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)

  1. __init__(self: visp._visp.gui.DisplayOpenCV, I: visp._visp.core.ImageGray, winx: int = -1, winy: int = -1, title: str = , type: visp._visp.core.Display.ScaleType) -> None

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)

title

Window title.

  1. __init__(self: visp._visp.gui.DisplayOpenCV, I: visp._visp.core.ImageRGBa, type: visp._visp.core.Display.ScaleType) -> None

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

Parameters:
I

Image to be displayed (not that image has to be initialized)

  1. __init__(self: visp._visp.gui.DisplayOpenCV, I: visp._visp.core.ImageRGBa, winx: int = -1, winy: int = -1, title: str = , type: visp._visp.core.Display.ScaleType) -> None

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

Parameters:
I

Image to be displayed (not that image has to be initialized)

title

Window title.

Methods

__init__

Overloaded function.

getImage

Get the window pixmap and put it in vpRGBa image.

getScreenHeight

Gets the screen vertical resolution in pixels.

getScreenSize

Gets screen resolution in pixels.

getScreenWidth

Gets the screen horizontal resolution in pixels.

init

Overloaded function.

Inherited Methods

flush

Overloaded function.

getWindowYPosition

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

getPointerMotionEvent

Overloaded function.

displayFrame

Overloaded function.

SCALE_5

setFont

Overloaded function.

display

Overloaded function.

displayCamera

Overloaded function.

SCALE_6

SCALE_7

SCALE_1

SCALE_8

SCALE_AUTO

getClickUp

Overloaded function.

getKeyboardEvent

Overloaded function.

displayEllipse

Overloaded function.

close

Overloaded function.

setBackground

Overloaded function.

setTitle

Overloaded function.

displayPoint

Overloaded function.

SCALE_3

computeAutoScale

param width:

Image size.

displayCircleStatic

Overloaded function.

getPointerPosition

Overloaded function.

getWindowXPosition

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

displayDotLine

Overloaded function.

getWidth

Return the display width.

SCALE_2

displayPolygon

Overloaded function.

SCALE_DEFAULT

isInitialised

Check if the display has been initialised.

SCALE_10

setWindowPosition

Overloaded function.

SCALE_4

setDownScalingFactor

Overloaded function.

displayCross

Overloaded function.

displayText

Overloaded function.

getHeight

Return the display height.

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.

displayLine

Overloaded function.

getClick

Overloaded function.

displayRectangle

Overloaded function.

getImageDownScalingFactor

Overloaded function.

displayArrow

Overloaded function.

displayROI

Overloaded function.

SCALE_9

flushROI

Overloaded function.

ScaleType

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

Operators

__doc__

__init__

Overloaded function.

__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)

Overloaded function.

  1. __init__(self: visp._visp.gui.DisplayOpenCV) -> None

Basic constructor.

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

#include <visp3/core/vpImage.h>
#include <visp3/gui/vpDisplayOpenCV.h>

#ifdef ENABLE_VISP_NAMESPACE
using namespace VISP_NAMESPACE_NAME;
#endif

int main()
{
  vpDisplayOpenCV d;
  vpImage<unsigned char> I(240, 384);
  d.init(I, 100, 200, "My display");
}
  1. __init__(self: visp._visp.gui.DisplayOpenCV, winx: int, winy: int, title: str = ) -> None

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

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

#include <visp3/core/vpImage.h>
#include <visp3/gui/vpDisplayOpenCV.h>

#ifdef ENABLE_VISP_NAMESPACE
using namespace VISP_NAMESPACE_NAME;
#endif

int main()
{
  vpDisplayOpenCV d(100, 200, "My display");
  vpImage<unsigned char> I(240, 384);
  d.init(I);
}
Parameters:
title

Window title.

  1. __init__(self: visp._visp.gui.DisplayOpenCV, I: visp._visp.core.ImageGray, type: visp._visp.core.Display.ScaleType) -> None

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)

  1. __init__(self: visp._visp.gui.DisplayOpenCV, I: visp._visp.core.ImageGray, winx: int = -1, winy: int = -1, title: str = , type: visp._visp.core.Display.ScaleType) -> None

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)

title

Window title.

  1. __init__(self: visp._visp.gui.DisplayOpenCV, I: visp._visp.core.ImageRGBa, type: visp._visp.core.Display.ScaleType) -> None

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

Parameters:
I

Image to be displayed (not that image has to be initialized)

  1. __init__(self: visp._visp.gui.DisplayOpenCV, I: visp._visp.core.ImageRGBa, winx: int = -1, winy: int = -1, title: str = , type: visp._visp.core.Display.ScaleType) -> None

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

Parameters:
I

Image to be displayed (not that image has to be initialized)

title

Window title.

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>

#ifdef ENABLE_VISP_NAMESPACE
using namespace VISP_NAMESPACE_NAME;
#endif

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>

#ifdef ENABLE_VISP_NAMESPACE
using namespace VISP_NAMESPACE_NAME;
#endif

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

getImage(self, I: visp._visp.core.ImageRGBa) None

Get the window pixmap and put it in vpRGBa image.

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>

#ifdef ENABLE_VISP_NAMESPACE
using namespace VISP_NAMESPACE_NAME;
#endif

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>

#ifdef ENABLE_VISP_NAMESPACE
using namespace VISP_NAMESPACE_NAME;
#endif

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>

#ifdef ENABLE_VISP_NAMESPACE
using namespace VISP_NAMESPACE_NAME;
#endif

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>

#ifdef ENABLE_VISP_NAMESPACE
using namespace VISP_NAMESPACE_NAME;
#endif

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.

getScreenHeight(self) int

Gets the screen vertical resolution in pixels.

getScreenSize(self, width: int, height: int) tuple[int, int]

Gets screen resolution in pixels.

Returns:

A tuple containing:

  • width

  • height

getScreenWidth(self) int

Gets the screen horizontal resolution in pixels.

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

init(*args, **kwargs)

Overloaded function.

  1. init(self: visp._visp.gui.DisplayOpenCV, I: visp._visp.core.ImageGray, winx: int = -1, winy: int = -1, title: str = ) -> None

Initialize the display (size, position and title) of a gray level image.

Parameters:
I

Image to be displayed (not that image has to be initialized)

title

Window title.

  1. init(self: visp._visp.gui.DisplayOpenCV, I: visp._visp.core.ImageRGBa, winx: int = -1, winy: int = -1, title: str = ) -> None

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)

title

Window title.

  1. init(self: visp._visp.gui.DisplayOpenCV, width: int, height: int, winx: int = -1, winy: int = -1, title: str = ) -> None

Initialize the display size, position and title.

Parameters:
title

Window title.

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>

#ifdef ENABLE_VISP_NAMESPACE
using namespace VISP_NAMESPACE_NAME;
#endif

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.