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.
__init__(self: visp._visp.core.Point) -> None
Basic constructor.
__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.
__init__(self: visp._visp.core.Point, oP: visp._visp.core.ColVector) -> None
Construction from a 3D point with coordinates in object frame.
__init__(self: visp._visp.core.Point, oP: list[float]) -> None
Construction from a 3D point with coordinates in object frame.
Methods
Overloaded function.
Overloaded function.
Overloaded function.
Overloaded function.
Get the point cW coordinate in the camera frame.
Get the point cX coordinate in the camera frame.
Get the point cY coordinate in the camera frame.
Get the point cZ coordinate in the camera frame.
Get the point oW coordinate in the object frame.
Get the point oX coordinate in the object frame.
Get the point oY coordinate in the object frame.
Get the point oZ coordinate in the object frame.
Get the point w coordinate in the image plane.
Get the point x coordinate in the image plane.
Get the point y coordinate in the image plane.
Overloaded function.
Overloaded function.
Set the point cW coordinate in the camera frame.
Set the point cX coordinate in the camera frame.
Set the point cY coordinate in the camera frame.
Set the point cZ coordinate in the camera frame.
Set the point oW coordinate in the object frame.
Set the point oX coordinate in the object frame.
Set the point oY coordinate in the object frame.
Set the point oZ coordinate in the object frame.
Set the point w coordinate in the image plane.
Set the point x coordinate in the image plane.
Set the point y coordinate in the image plane.
Inherited Methods
Return object parameters expressed in the 2D image plane computed by perspective projection.
user
vpDisplayForwardProjection
Return object parameters expressed in the 3D camera frame.
cP
Track the feature parameters in the camera frame ( vpTracker::cP ) and than compute the projection of these parameters in the image plane ( vpTracker::p ).
Return object parameters expressed in the 3D object frame.
p
Overloaded function.
cPAvailable
Used for memory issue especially in the vpServo class.
Print to stdout the feature parameters in:
oP
Operators
__doc__
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
- __init__(*args, **kwargs)¶
Overloaded function.
__init__(self: visp._visp.core.Point) -> None
Basic constructor.
__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.
__init__(self: visp._visp.core.Point, oP: visp._visp.core.ColVector) -> None
Construction from a 3D point with coordinates in object frame.
__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.
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.
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.
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.
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.
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.
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.
getWorldCoordinates(self: visp._visp.core.Point, oP: visp._visp.core.ColVector) -> None
Get the point object frame normalized coordinates.
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_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_p(self) visp._visp.core.ColVector ¶
Return object parameters expressed in the 2D image plane computed by perspective projection.
- print(self) None ¶
Print to stdout the feature parameters in:
the object frame
the camera frame
the image plane.
- project(*args, **kwargs)¶
Overloaded function.
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.
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.
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.
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.
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.
setWorldCoordinates(self: visp._visp.core.Point, oP: visp._visp.core.ColVector) -> None
Set the 3D point object frame coordinates.
setWorldCoordinates(self: visp._visp.core.Point, oP: list[float]) -> None
Set the 3D point object frame coordinates.
- 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.