DisplayX¶
- class DisplayX(*args, **kwargs)¶
Bases:
Display
Use the X11 console to display images on unix-like OS. Thus to enable this class X11 should be installed. Installation instructions are provided here https://visp.inria.fr/3rd_x11 .
This class define the X11 console to display images It also define method to display some geometric feature (point, line, circle) in the image.
The example below shows how to display an image with this video device.
#include <visp3/core/vpImagePoint.h> #include <visp3/gui/vpDisplayX.h> #include <visp3/io/vpImageIo.h> #ifdef ENABLE_VISP_NAMESPACE using namespace VISP_NAMESPACE_NAME; #endif int main() { 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"); #if defined(VISP_HAVE_X11) vpDisplayX d; // Initialize the display with the image I. Display and image are // now link together. d.init(I); #endif // Specify the window location vpDisplay::setWindowPosition(I, 400, 100); // Set the display window title vpDisplay::setTitle(I, "My X11 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(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]; 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); }
Overloaded function.
__init__(self: visp._visp.gui.DisplayX) -> 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/vpDisplayX.h> #ifdef ENABLE_VISP_NAMESPACE using namespace VISP_NAMESPACE_NAME; #endif int main() { vpDisplayX d; vpImage<unsigned char> I(240, 384); d.init(I, 100, 200, "My display"); }
__init__(self: visp._visp.gui.DisplayX, 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/vpDisplayX.h> #ifdef ENABLE_VISP_NAMESPACE using namespace VISP_NAMESPACE_NAME; #endif int main() { vpDisplayX d(100, 200, "My display"); vpImage<unsigned char> I(240, 384); d.init(I); }
- Parameters:
- title
Window title.
__init__(self: visp._visp.gui.DisplayX, 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)
__init__(self: visp._visp.gui.DisplayX, 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.
__init__(self: visp._visp.gui.DisplayX, 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).
__init__(self: visp._visp.gui.DisplayX, 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
Overloaded function.
Get the window pixmap and put it in vpRGBa image.
Gets the window depth (8, 16, 24, 32).
Gets the screen vertical resolution in pixels.
Gets screen resolution in pixels.
Gets the screen horizontal resolution in pixels.
Overloaded function.
Inherited Methods
Check if the display has been initialised.
Overloaded function.
Overloaded function.
Overloaded function.
Overloaded function.
Return the display width.
SCALE_7
Overloaded function.
SCALE_8
SCALE_3
Overloaded function.
Overloaded function.
Overloaded function.
SCALE_2
Overloaded function.
SCALE_DEFAULT
Overloaded function.
Return the position (along the vertical axis) on the screen of the display window.
SCALE_4
Overloaded function.
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.
Overloaded function.
Overloaded function.
Overloaded function.
SCALE_AUTO
Overloaded function.
Return the display height.
Overloaded function.
Overloaded function.
Overloaded function.
- param width:
Image size.
Overloaded function.
Overloaded function.
Overloaded function.
Overloaded function.
Overloaded function.
Return the position (along the horizontal axis) on the screen of the display window.
Values that could be applied to a display to down scale the size of the display.
SCALE_5
Overloaded function.
Overloaded function.
SCALE_10
SCALE_1
SCALE_9
Overloaded function.
SCALE_6
Overloaded function.
Overloaded function.
Operators
__doc__
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 .
- __init__(*args, **kwargs)¶
Overloaded function.
__init__(self: visp._visp.gui.DisplayX) -> 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/vpDisplayX.h> #ifdef ENABLE_VISP_NAMESPACE using namespace VISP_NAMESPACE_NAME; #endif int main() { vpDisplayX d; vpImage<unsigned char> I(240, 384); d.init(I, 100, 200, "My display"); }
__init__(self: visp._visp.gui.DisplayX, 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/vpDisplayX.h> #ifdef ENABLE_VISP_NAMESPACE using namespace VISP_NAMESPACE_NAME; #endif int main() { vpDisplayX d(100, 200, "My display"); vpImage<unsigned char> I(240, 384); d.init(I); }
- Parameters:
- title
Window title.
__init__(self: visp._visp.gui.DisplayX, 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)
__init__(self: visp._visp.gui.DisplayX, 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.
__init__(self: visp._visp.gui.DisplayX, 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).
__init__(self: visp._visp.gui.DisplayX, 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.
close(I: visp._visp.core.ImageGray) -> None
Close the display attached to I.
close(I: visp._visp.core.ImageRGBa) -> None
Close the display attached to I.
- static display(*args, **kwargs)¶
Overloaded function.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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
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
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
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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()
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.
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()
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.
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 .
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 .
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 .
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.
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 .
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 .
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 .
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.
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 .
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.
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 .
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.
- getImage(self, I: visp._visp.core.ImageRGBa) None ¶
Get the window pixmap and put it in vpRGBa image.
- static getImageDownScalingFactor(*args, **kwargs)¶
Overloaded function.
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.
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.
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 .
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.
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 .
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.
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.
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.
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.
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.
- getScreenSize(self, width: int, height: int) tuple[int, int] ¶
Gets screen resolution in pixels.
- Returns:
A tuple containing:
width
height
- 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.
init(self: visp._visp.gui.DisplayX, I: visp._visp.core.ImageGray, win_x: int = -1, win_y: int = -1, win_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)
- win_x
The window is set at position (win_x,win_y) with column index and row index respectively.
- win_y
The window is set at position (win_x,win_y) with column index and row index respectively.
- win_title
Window title.
init(self: visp._visp.gui.DisplayX, I: visp._visp.core.ImageRGBa, win_x: int = -1, win_y: int = -1, win_title: str = ) -> None
Initialize the display (size, position and title) of a color image in RGBa format.
- Parameters:
- I
Image to be displayed (note that image has to be initialized)
- win_x
The window is set at position (win_x,win_y) with column index and row index respectively.
- win_y
The window is set at position (win_x,win_y) with column index and row index respectively.
- win_title
Window title.
init(self: visp._visp.gui.DisplayX, win_width: int, win_height: int, win_x: int = -1, win_y: int = -1, win_title: str = ) -> None
Initialize the display size, position and title.
- Parameters:
- win_width
Width and height of the window.
- win_height
Width and height of the window.
- win_x
The window is set at position (win_x,win_y) with column index and row index respectively.
- win_y
The window is set at position (win_x,win_y) with column index and row index respectively.
- win_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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.