ImageDraw¶
- class ImageDraw¶
Bases:
pybind11_object
Drawing functions for image.
Methods
Overloaded function.
Overloaded function.
Overloaded function.
Overloaded function.
Overloaded function.
Overloaded function.
Overloaded function.
Overloaded function.
Overloaded function.
Overloaded function.
Inherited Methods
Operators
__doc__
__module__
Attributes
__annotations__
- static drawArrow(*args, **kwargs)¶
Overloaded function.
drawArrow(I: visp._visp.core.ImageGray, ip1: visp._visp.core.ImagePoint, ip2: visp._visp.core.ImagePoint, color: int, w: int = 4, h: int = 2, thickness: int = 1) -> None
Draw an arrow from image point ip1 to image point ip2 .
- Parameters:
- I
Image where to draw the arrow.
- 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.
drawArrow(I: visp._visp.core.ImageRGBa, ip1: visp._visp.core.ImagePoint, ip2: visp._visp.core.ImagePoint, color: visp._visp.core.Color, w: int = 4, h: int = 2, thickness: int = 1) -> None
Draw an arrow from image point ip1 to image point ip2 .
- Parameters:
- I
Image where to draw the arrow.
- 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.
- static drawCircle(*args, **kwargs)¶
Overloaded function.
drawCircle(I: visp._visp.core.ImageGray, circle: visp._visp.core.ImageCircle, color: int, thickness: int = 1) -> None
Draw a circle in an image.
- Parameters:
- I
Image where to draw the circle.
- circle
Circle to draw.
- color
Circle color.
- thickness
Thickness of the circle.
drawCircle(I: visp._visp.core.ImageGray, center: visp._visp.core.ImagePoint, radius: int, color: int, thickness: int = 1) -> None
Draw a circle in an image.
- Parameters:
- I
Image where to draw the circle.
- center
Circle center position.
- radius
Circle radius.
- color
Circle color.
- thickness
Thickness of the circle.
drawCircle(I: visp._visp.core.ImageRGBa, circle: visp._visp.core.ImageCircle, color: visp._visp.core.Color, thickness: int = 1) -> None
Draw a circle in an image.
- Parameters:
- I
Image where to draw the circle.
- circle
Circle to draw.
- color
Circle color.
- thickness
Thickness of the circle.
drawCircle(I: visp._visp.core.ImageRGBa, center: visp._visp.core.ImagePoint, radius: int, color: visp._visp.core.Color, thickness: int = 1) -> None
Draw a circle in an image.
- Parameters:
- I
Image where to draw the circle.
- center
Circle center position.
- radius
Circle radius.
- color
Circle color.
- thickness
Thickness of the circle.
- static drawCross(*args, **kwargs)¶
Overloaded function.
drawCross(I: visp._visp.core.ImageGray, ip: visp._visp.core.ImagePoint, size: int, color: int, thickness: int = 1) -> None
Draw a cross in an image at position given by ip location.
- Parameters:
- I
Image where to draw the cross.
- ip
Cross location.
- size
Size (width and height) of the cross.
- color
Cross color.
- thickness
Thickness of the lines used to display the cross.
drawCross(I: visp._visp.core.ImageRGBa, ip: visp._visp.core.ImagePoint, size: int, color: visp._visp.core.Color, thickness: int = 1) -> None
Draw a cross in an image at position given by ip location.
- Parameters:
- I
Image where to draw the cross.
- ip
Cross location.
- size
Size (width and height) of the cross.
- color
Cross color.
- thickness
Thickness of the lines used to display the cross.
- static drawDottedLine(*args, **kwargs)¶
Overloaded function.
drawDottedLine(I: visp._visp.core.ImageGray, ip1: visp._visp.core.ImagePoint, ip2: visp._visp.core.ImagePoint, color: int, thickness: int = 1) -> None
Draw a dashed line in an image between two image points.
- Parameters:
- I
Image where to draw the dashed line.
- ip1
Initial and final image points.
- ip2
Initial and final image points.
- color
Line color.
- thickness
Dashed line thickness.
drawDottedLine(I: visp._visp.core.ImageRGBa, ip1: visp._visp.core.ImagePoint, ip2: visp._visp.core.ImagePoint, color: visp._visp.core.Color, thickness: int = 1) -> None
Draw a dashed line in an image between two image points.
- Parameters:
- I
Image where to draw the dashed line.
- ip1
Initial and final image points.
- ip2
Initial and final image points.
- color
Line color.
- thickness
Dashed line thickness.
- static drawEllipse(*args, **kwargs)¶
Overloaded function.
drawEllipse(I: visp._visp.core.ImageGray, center: visp._visp.core.ImagePoint, coef1: float, coef2: float, coef3: float, use_normalized_centered_moments: bool, color: int, smallalpha: float = 0, highalpha: float = 2*M_PI, thickness: int = 1) -> None
Draw an ellipse in an image from its parameters expressed in pixels.The following example shows how to use for example this function to draw the result of a tracking.
vpMeEllipse ellipse; ... vpDisplay::display(I); ellipse.track(I); vpImageDraw::drawEllipse(I, ellipse.getCenter(), ellipse.get_nij()[0], ellipse.get_nij()[1], ellipse.get_nij()[2], true, ellipse.getSmallestAngle(), ellipse.getHighestAngle(), vpColor::orange, 1);
- Parameters:
- I
Image where to draw the ellipse.
- 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.
- smallalpha
Smallest \(alpha\) angle in rad (0 for a complete ellipse).
- highalpha
Highest \(alpha\) angle in rad (2 \(\Pi\) for a complete ellipse).
- thickness
Ellipse thickness.
drawEllipse(I: visp._visp.core.ImageRGBa, center: visp._visp.core.ImagePoint, coef1: float, coef2: float, coef3: float, use_normalized_centered_moments: bool, color: visp._visp.core.Color, smallalpha: float = 0, highalpha: float = 2*M_PI, thickness: int = 1) -> None
Draw an ellipse in an image from its parameters expressed in pixels.The following example shows how to use for example this function to draw the result of a tracking.
vpMeEllipse ellipse; ... vpDisplay::display(I); ellipse.track(I); vpImageDraw::drawEllipse(I, ellipse.getCenter(), ellipse.get_nij()[0], ellipse.get_nij()[1], ellipse.get_nij()[2], true, ellipse.getSmallestAngle(), ellipse.getHighestAngle(), vpColor::orange, 1);
- Parameters:
- I
Image where to draw the ellipse.
- 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.
- smallalpha
Smallest \(alpha\) angle in rad (0 for a complete ellipse).
- highalpha
Highest \(alpha\) angle in rad (2 \(\Pi\) for a complete ellipse).
- thickness
Ellipse thickness.
- static drawFrame(*args, **kwargs)¶
Overloaded function.
drawFrame(I: visp._visp.core.ImageGray, cMo: visp._visp.core.HomogeneousMatrix, cam: visp._visp.core.CameraParameters, size: float, color: int, thickness: int = 1, offset: visp._visp.core.ImagePoint = vpImagePoint(0,0)) -> None
Draw the projection in an image 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
Image where to draw the ellipse.
- 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.
drawFrame(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)) -> None
Draw the projection in an image 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
Image where to draw the ellipse.
- 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.
- static drawLine(*args, **kwargs)¶
Overloaded function.
drawLine(I: visp._visp.core.ImageGray, ip1: visp._visp.core.ImagePoint, ip2: visp._visp.core.ImagePoint, color: int, thickness: int = 1) -> None
Draw a line in an image between two image points.
- Parameters:
- I
Image where to draw the line.
- ip1
Initial and final image points.
- ip2
Initial and final image points.
- color
Line color.
- thickness
Dashed line thickness.
drawLine(I: visp._visp.core.ImageRGBa, ip1: visp._visp.core.ImagePoint, ip2: visp._visp.core.ImagePoint, color: visp._visp.core.Color, thickness: int = 1) -> None
Draw a line in an image between two image points.
- Parameters:
- I
Image where to draw the line.
- ip1
Initial and final image points.
- ip2
Initial and final image points.
- color
Line color.
- thickness
Dashed line thickness.
- static drawPoint(*args, **kwargs)¶
Overloaded function.
drawPoint(I: visp._visp.core.ImageGray, ip: visp._visp.core.ImagePoint, color: int, thickness: int = 1) -> None
Draw in an image a point at the image point ip location.
- Parameters:
- I
Image where to draw the point.
- ip
Point location.
- color
Point color.
- thickness
Thickness of the point
drawPoint(I: visp._visp.core.ImageRGBa, ip: visp._visp.core.ImagePoint, color: visp._visp.core.Color, thickness: int = 1) -> None
Draw in an image a point at the image point ip location.
- Parameters:
- I
Image where to draw the point.
- ip
Point location.
- color
Point color.
- thickness
Thickness of the point
- static drawPolygon(*args, **kwargs)¶
Overloaded function.
drawPolygon(I: visp._visp.core.ImageGray, vip: list[visp._visp.core.ImagePoint], color: int, thickness: int = 1, closed: bool = true) -> None
Draw in an image a polygon defined by a vector of image points.
- Parameters:
- I
Image where to draw the polygon.
- vip
Vector of image point that define the vertexes of the polygon.
- color
Polygon color.
- thickness
Polygon thickness.
- closed
When true display a closed polygon with a segment between first and last image point.
drawPolygon(I: visp._visp.core.ImageRGBa, vip: list[visp._visp.core.ImagePoint], color: visp._visp.core.Color, thickness: int = 1, closed: bool = true) -> None
Draw in an image a polygon defined by a vector of image points.
- Parameters:
- I
Image where to draw the polygon.
- vip
Vector of image point that define the vertexes of the polygon.
- color
Polygon color.
- thickness
Polygon thickness.
- closed
When true display a closed polygon with a segment between first and last image point.
- static drawRectangle(*args, **kwargs)¶
Overloaded function.
drawRectangle(I: visp._visp.core.ImageGray, rectangle: visp._visp.core.Rect, color: int, fill: bool = false, thickness: int = 1) -> None
Draw in an image a rectangle with topLeft as the top-left corner and width and height the rectangle size.
- Parameters:
- I
Image where to draw the rectangle.
- rectangle
Rectangle characteristics.
- color
Rectangle color.
- fill
When set to true fill the rectangle.
- thickness
Thickness of the four lines used to display the rectangle. This parameter is only useful when fill is set to false.
drawRectangle(I: visp._visp.core.ImageRGBa, rectangle: visp._visp.core.Rect, color: visp._visp.core.Color, fill: bool = false, thickness: int = 1) -> None
Draw in an image a rectangle with topLeft as the top-left corner and width and height the rectangle size.
- Parameters:
- I
Image where to draw the rectangle.
- rectangle
Rectangle characteristics.
- color
Rectangle color.
- fill
When set to true fill the rectangle.
- thickness
Thickness of the four lines used to display the rectangle. This parameter is only useful when fill is set to false.