Point

class Point(*args, **kwargs)

Bases: ForwardProjection

Class that defines a 3D point in the object frame and allows forward projection of a 3D point in the camera frame and in the 2D image plane by perspective projection. All the parameters must be set in meter.

A 3D point has the followings parameters:

  • in the object frame : the normalized 3D coordinates oX, oY, oZ, oW of the point. These parameters registered in vpForwardProjection::oP internal 4-dim vector are set using the constructors vpPoint (double oX, double oY, double oZ), vpPoint(const vpColVector &oP) and vpPoint(const std::vector<double> &oP) or the functions setWorldCoordinates(double oX, double oY, double oZ) , setWorldCoordinates(const vpColVector &oP) and setWorldCoordinates(const std::vector<double> &oP) . To get theses parameters use get_oP() .

  • in the camera frame : the normalized coordinates cX, cY, cZ, 1 of the point. These parameters registered in vpTracker::cP internal 4-dim vector are computed using changeFrame(const vpHomogeneousMatrix &cMo, vpColVector &cP) const or changeFrame(const vpHomogeneousMatrix &cMo) . These parameters could be retrieved using get_X() , get_Y() and get_Z() . To get theses parameters use get_cP() .

  • in the image plane : the 2D normalized coordinates (x, y, 1) corresponding to the perspective projection of the point. These parameters are registered in vpTracker::p internal 3-dim vector and computed using projection() and projection(const vpColVector &cP, vpColVector &p) const . They could be retrieved using get_x() and get_y() . They correspond to 2D normalized point parameters with values expressed in meters. To get theses parameters use get_p() .

Overloaded function.

  1. __init__(self: visp._visp.core.Point) -> None

Basic constructor.

  1. __init__(self: visp._visp.core.Point, oX: float, oY: float, oZ: float) -> None

Construction from a 3D point with coordinates in object frame.

Parameters:
oX

Coordinates of a 3D point in object frame.

oY

Coordinates of a 3D point in object frame.

oZ

Coordinates of a 3D point in object frame.

  1. __init__(self: visp._visp.core.Point, oP: visp._visp.core.ColVector) -> None

Construction from a 3D point with coordinates in object frame.

  1. __init__(self: visp._visp.core.Point, oP: list[float]) -> None

Construction from a 3D point with coordinates in object frame.

Methods

__init__

Overloaded function.

changeFrame

Overloaded function.

display

Overloaded function.

getWorldCoordinates

Overloaded function.

get_W

Get the point cW coordinate in the camera frame.

get_X

Get the point cX coordinate in the camera frame.

get_Y

Get the point cY coordinate in the camera frame.

get_Z

Get the point cZ coordinate in the camera frame.

get_oW

Get the point oW coordinate in the object frame.

get_oX

Get the point oX coordinate in the object frame.

get_oY

Get the point oY coordinate in the object frame.

get_oZ

Get the point oZ coordinate in the object frame.

get_w

Get the point w coordinate in the image plane.

get_x

Get the point x coordinate in the image plane.

get_y

Get the point y coordinate in the image plane.

projection

Overloaded function.

setWorldCoordinates

Overloaded function.

set_W

Set the point cW coordinate in the camera frame.

set_X

Set the point cX coordinate in the camera frame.

set_Y

Set the point cY coordinate in the camera frame.

set_Z

Set the point cZ coordinate in the camera frame.

set_oW

Set the point oW coordinate in the object frame.

set_oX

Set the point oX coordinate in the object frame.

set_oY

Set the point oY coordinate in the object frame.

set_oZ

Set the point oZ coordinate in the object frame.

set_w

Set the point w coordinate in the image plane.

set_x

Set the point x coordinate in the image plane.

set_y

Set the point y coordinate in the image plane.

Inherited Methods

get_p

Return object parameters expressed in the 2D image plane computed by perspective projection.

user

vpDisplayForwardProjection

get_cP

Return object parameters expressed in the 3D camera frame.

getDeallocate

cP

track

Track the feature parameters in the camera frame ( vpTracker::cP ) and than compute the projection of these parameters in the image plane ( vpTracker::p ).

get_oP

Return object parameters expressed in the 3D object frame.

setDeallocate

p

project

Overloaded function.

cPAvailable

ForwardProjectionDeallocatorType

Used for memory issue especially in the vpServo class.

print

Print to stdout the feature parameters in:

oP

Operators

__doc__

__init__

Overloaded function.

__module__

__repr__

Attributes

__annotations__

cP

cPAvailable

oP

p

user

vpDisplayForwardProjection

class ForwardProjectionDeallocatorType(self, value: int)

Bases: pybind11_object

Used for memory issue especially in the vpServo class.

Values:

  • user

  • vpDisplayForwardProjection

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

Overloaded function.

  1. __init__(self: visp._visp.core.Point) -> None

Basic constructor.

  1. __init__(self: visp._visp.core.Point, oX: float, oY: float, oZ: float) -> None

Construction from a 3D point with coordinates in object frame.

Parameters:
oX

Coordinates of a 3D point in object frame.

oY

Coordinates of a 3D point in object frame.

oZ

Coordinates of a 3D point in object frame.

  1. __init__(self: visp._visp.core.Point, oP: visp._visp.core.ColVector) -> None

Construction from a 3D point with coordinates in object frame.

  1. __init__(self: visp._visp.core.Point, oP: list[float]) -> None

Construction from a 3D point with coordinates in object frame.

changeFrame(*args, **kwargs)

Overloaded function.

  1. changeFrame(self: visp._visp.core.Point, cMo: visp._visp.core.HomogeneousMatrix, cP: visp._visp.core.ColVector) -> None

From the 3D coordinates of the point in the object frame oP that are set using for example setWorldCoordinates() or set_oX() , set_oY() , set_oZ() , compute the 3D coordinates of the point in the camera frame cP = cMo * oP.

Parameters:
cMo

Transformation from camera to object frame.

  1. changeFrame(self: visp._visp.core.Point, cMo: visp._visp.core.HomogeneousMatrix) -> None

From the 3D coordinates of the point in the object frame oP that are set using for example setWorldCoordinates() or set_oX() , set_oY() , set_oZ() , compute the 3D coordinates of the point in the camera frame cP = cMo * oP.

Parameters:
cMo

Transformation from camera to object frame.

display(*args, **kwargs)

Overloaded function.

  1. display(self: visp._visp.core.Point, I: visp._visp.core.ImageGray, cam: visp._visp.core.CameraParameters, color: visp._visp.core.Color = vpColor::green, thickness: int = 1) -> None

Display the projection of a 3D point in image I .

Parameters:
I

Image used as background.

cam

Camera parameters.

color

Color used to draw the point.

thickness

Thickness used to draw the point.

  1. display(self: visp._visp.core.Point, I: visp._visp.core.ImageGray, cMo: visp._visp.core.HomogeneousMatrix, cam: visp._visp.core.CameraParameters, color: visp._visp.core.Color = vpColor::green, thickness: int = 1) -> None

Display the projection of a 3D point in image I . This method is non destructive wrt. cP and p internal 3D point parameters.

Parameters:
I

Image used as background.

cMo

Homogeneous transformation from camera frame to object frame. The point is considered as viewed from this camera position.

cam

Camera parameters.

color

Color used to draw the sphere.

thickness

Thickness used to draw the sphere.

  1. display(self: visp._visp.core.Point, I: visp._visp.core.ImageRGBa, cam: visp._visp.core.CameraParameters, color: visp._visp.core.Color = vpColor::green, thickness: int = 1) -> None

Display the projection of a 3D point in image I .

Parameters:
I

Image used as background.

cam

Camera parameters.

color

Color used to draw the point.

thickness

Thickness used to draw the point.

  1. display(self: visp._visp.core.Point, I: visp._visp.core.ImageRGBa, cMo: visp._visp.core.HomogeneousMatrix, cam: visp._visp.core.CameraParameters, color: visp._visp.core.Color = vpColor::green, thickness: int = 1) -> None

Display the projection of a 3D point in image I . This method is non destructive wrt. cP and p internal 3D point parameters.

Parameters:
I

Image used as background.

cMo

Homogeneous transformation from camera frame to object frame. The point is considered as viewed from this camera position.

cam

Camera parameters.

color

Color used to draw the sphere.

thickness

Thickness used to draw the sphere.

getDeallocate(self) visp._visp.core.ForwardProjection.ForwardProjectionDeallocatorType
getWorldCoordinates(*args, **kwargs)

Overloaded function.

  1. getWorldCoordinates(self: visp._visp.core.Point, oP: visp._visp.core.ColVector) -> None

Get the point object frame normalized coordinates.

  1. getWorldCoordinates(self: visp._visp.core.Point) -> visp._visp.core.ColVector

Return the point object frame normalized coordinates.

Returns:

Normalized coordinates of the point in the object frame oP = (oX, oY, oZ, oW) as a 4-dim vector.

get_W(self) float

Get the point cW coordinate in the camera frame.

get_X(self) float

Get the point cX coordinate in the camera frame.

get_Y(self) float

Get the point cY coordinate in the camera frame.

get_Z(self) float

Get the point cZ coordinate in the camera frame.

get_cP(self) visp._visp.core.ColVector

Return object parameters expressed in the 3D camera frame.

get_oP(self) visp._visp.core.ColVector

Return object parameters expressed in the 3D object frame.

get_oW(self) float

Get the point oW coordinate in the object frame.

get_oX(self) float

Get the point oX coordinate in the object frame.

get_oY(self) float

Get the point oY coordinate in the object frame.

get_oZ(self) float

Get the point oZ coordinate in the object frame.

get_p(self) visp._visp.core.ColVector

Return object parameters expressed in the 2D image plane computed by perspective projection.

get_w(self) float

Get the point w coordinate in the image plane.

get_x(self) float

Get the point x coordinate in the image plane.

get_y(self) float

Get the point y coordinate in the image plane.

print(self) None

Print to stdout the feature parameters in:

  • the object frame

  • the camera frame

  • the image plane.

project(*args, **kwargs)

Overloaded function.

  1. project(self: visp._visp.core.ForwardProjection) -> None

Compute the feature parameters in the image plane ( vpTracker::p ) from the parameters in the camera frame ( vpTracker::cP ).

Warning

Be careful to update vpTracker::p and vpTracker::cP public attributes before the call of this method.

  1. project(self: visp._visp.core.ForwardProjection, cMo: visp._visp.core.HomogeneousMatrix) -> None

Compute the feature parameters in the camera frame ( vpTracker::cP ) and than compute the projection of these parameters in the image plane ( vpTracker::p ).

Warning

The feature parameters in the object frame ( vpForwardProjection :oP) need to be set prior the use of this method. To initialize these parameters see setWorldCoordinates() .

Parameters:
cMo

The homogeneous matrix corresponding to the pose between the camera frame and the object frame.

projection(*args, **kwargs)

Overloaded function.

  1. projection(self: visp._visp.core.Point, _cP: visp._visp.core.ColVector, _p: visp._visp.core.ColVector) -> None

Projection onto the image plane of a point. Input: the 3D coordinates in the camera frame _cP, output : the 2D coordinates _p.

Compute the perspective projection of a point _cP.

  1. projection(self: visp._visp.core.Point) -> None

Perspective projection of the 3D point.

Projection onto the image plane of the point. Update the object attribute p (2D homogeneous coordinates) according to object attribute cP (current 3D coordinates in the camera frame).

setDeallocate(self, d: visp._visp.core.ForwardProjection.ForwardProjectionDeallocatorType) None
setWorldCoordinates(*args, **kwargs)

Overloaded function.

  1. setWorldCoordinates(self: visp._visp.core.Point, oX: float, oY: float, oZ: float) -> None

Set the 3D point object frame coordinates oP = (oX, oY, oZ, 1).

Parameters:
oX

Coordinates of a 3D point in the object frame.

oY

Coordinates of a 3D point in the object frame.

oZ

Coordinates of a 3D point in the object frame.

  1. setWorldCoordinates(self: visp._visp.core.Point, oP: visp._visp.core.ColVector) -> None

Set the 3D point object frame coordinates.

  1. setWorldCoordinates(self: visp._visp.core.Point, oP: list[float]) -> None

Set the 3D point object frame coordinates.

set_W(self, cW: float) None

Set the point cW coordinate in the camera frame.

set_X(self, cX: float) None

Set the point cX coordinate in the camera frame.

set_Y(self, cY: float) None

Set the point cY coordinate in the camera frame.

set_Z(self, cZ: float) None

Set the point cZ coordinate in the camera frame.

set_oW(self, oW: float) None

Set the point oW coordinate in the object frame.

set_oX(self, oX: float) None

Set the point oX coordinate in the object frame.

set_oY(self, oY: float) None

Set the point oY coordinate in the object frame.

set_oZ(self, oZ: float) None

Set the point oZ coordinate in the object frame.

set_w(self, w: float) None

Set the point w coordinate in the image plane.

set_x(self, x: float) None

Set the point x coordinate in the image plane.

set_y(self, y: float) None

Set the point y coordinate in the image plane.

track(self, cMo: visp._visp.core.HomogeneousMatrix) None

Track the feature parameters in the camera frame ( vpTracker::cP ) and than compute the projection of these parameters in the image plane ( vpTracker::p ).

This method is similar to project(const vpHomogeneousMatrix &) .

Warning

The feature parameters in the object frame ( vpForwardProjection :oP) need to be set prior the use of this method. To initialize these parameters see setWorldCoordinates() .

Parameters:
cMo: visp._visp.core.HomogeneousMatrix

The homogeneous matrix corresponding to the pose between the camera frame and the object frame.