Visual Servoing Platform
version 3.6.1 under development (2024-11-21)
|
#include <visp3/core/vpPlane.h>
Public Types | |
enum | vpPlaneFrame { object_frame , camera_frame } |
Public Member Functions | |
vpPlane () | |
vpPlane (const vpPlane &P) | |
vpPlane (double A, double B, double C, double D) | |
vpPlane (const vpPoint &P, const vpColVector &n, vpPlaneFrame frame=camera_frame) | |
vpPlane (const vpPoint &P, const vpPoint &Q, const vpPoint &R, vpPlaneFrame frame=camera_frame) | |
double | computeZ (double x, double y) const |
void | init (const vpPoint &P, const vpPoint &Q, const vpPoint &R, vpPlaneFrame frame=camera_frame) |
void | init (const vpColVector &P, const vpColVector &n) |
void | init (const vpPlane &P) |
void | setA (double a) |
void | setB (double b) |
void | setC (double c) |
void | setD (double d) |
void | setABCD (double a, double b, double c, double d) |
vpPlane & | operator= (const vpPlane &f) |
double | getA () const |
double | getB () const |
double | getC () const |
double | getD () const |
vpColVector | getABCD () const |
vpColVector | abcd () const |
vpColVector | getNormal () const |
void | getNormal (vpColVector &n) const |
void | projectionPointOnPlan (const vpPoint &P, vpPoint &Pproj) const |
double | rayIntersection (const vpPoint &M0, const vpPoint &M1, vpColVector &H) const |
double | getIntersection (const vpColVector &M1, vpColVector &H) const |
void | changeFrame (const vpHomogeneousMatrix &cMo) |
Friends | |
VISP_EXPORT std::ostream & | operator<< (std::ostream &os, const vpPlane &p) |
This class defines the container for a plane geometrical structure.
A plane is given by the equation where (x,y,z) are the coordinates of a point and where is a normal vector of the plane.
vpPlane::vpPlane | ( | ) |
Basic constructor that set the plane parameters A, B, C, D to zero.
Definition at line 62 of file vpPlane.cpp.
vpPlane::vpPlane | ( | const vpPlane & | P | ) |
vpPlane::vpPlane | ( | double | a, |
double | b, | ||
double | c, | ||
double | d | ||
) |
Plane constructor from A, B, C, D parameters.
A plane is given by the equation where (x,y,z) are the coordinates of a point and is the normal vector of the plane.
a,b,c,d | : Parameters of the plane. |
Definition at line 74 of file vpPlane.cpp.
vpPlane::vpPlane | ( | const vpPoint & | P, |
const vpColVector & | n, | ||
vpPlaneFrame | frame = camera_frame |
||
) |
Plane constructor from a point P on the plane and the normal n to the plane.
A plane is given by the equation where (x,y,z) are the coordinates of a point and is the normal vector of the plane.
P | : A point with coordinates (x,y,z) on the plane. The frame parameter indicates if the coordinates of this points that are used are expressed in the camera of object frame. |
n | : The normal to the plane. |
frame | Indicates if the plane should be initialized from the point P coordinates expressed in the camera or object frame. |
Definition at line 106 of file vpPlane.cpp.
References camera_frame, vpPoint::get_oX(), vpPoint::get_oY(), vpPoint::get_oZ(), vpPoint::get_X(), vpPoint::get_Y(), and vpPoint::get_Z().
vpPlane::vpPlane | ( | const vpPoint & | P, |
const vpPoint & | Q, | ||
const vpPoint & | R, | ||
vpPlaneFrame | frame = camera_frame |
||
) |
Compute the equation of a plane given three point P, Q, R.
The normal to the plane is given by: n = PQ x PR
P,Q,R | Three points on the plane. |
frame | Indicates if the plane should be initialized from the points coordinates expressed in the camera or object frame. |
Definition at line 235 of file vpPlane.cpp.
References init().
|
inline |
void vpPlane::changeFrame | ( | const vpHomogeneousMatrix & | cMo | ) |
Considering the plane in the Ro frame computes the equation of the plane in the Rc frame.
cMo | : Homogeneous transformation from Rc to Ro frames. |
Definition at line 391 of file vpPlane.cpp.
Referenced by vpMbtFaceDepthNormal::computeInteractionMatrix(), vpMbtFaceDepthDense::computeInteractionMatrixAndResidu(), vpMbtFaceDepthNormal::displayFeature(), vpMbtFaceDepthNormal::estimateFeatures(), vpMbtFaceDepthNormal::estimatePlaneEquationSVD(), vpMbtFaceDepthNormal::getFeaturesForDisplay(), and vpMbtFaceDepthNormal::planeIsInvalid().
double vpPlane::computeZ | ( | double | x, |
double | y | ||
) | const |
Compute Z value of a 3D point located on the plane from its perspective projection coordinates.
[in] | x,y | : Coordinates of a point in the image plane. These coordinates are the one obtained by perspective projection of a 3D point. |
Definition at line 245 of file vpPlane.cpp.
References getA(), getB(), getC(), and getD().
Referenced by vpPose::computePlanarObjectPoseFromRGBD().
|
inline |
Definition at line 100 of file vpPlane.h.
Referenced by vpMbTracker::addPolygon(), vpMbTracker::addProjectionErrorPolygon(), vpMbtDistanceCircle::buildFrom(), vpKeyPoint::compute3D(), vpMbtFaceDepthNormal::computeInteractionMatrix(), vpMbtFaceDepthDense::computeInteractionMatrixAndResidu(), computeZ(), vpMbtFaceDepthNormal::displayFeature(), vpMbtFaceDepthNormal::estimateFeatures(), vpMbtFaceDepthNormal::estimatePlaneEquationSVD(), vpMbtFaceDepthNormal::getFeaturesForDisplay(), init(), rayIntersection(), and vpPlane().
|
inline |
|
inline |
Definition at line 102 of file vpPlane.h.
Referenced by vpMbTracker::addPolygon(), vpMbTracker::addProjectionErrorPolygon(), vpMbtDistanceCircle::buildFrom(), vpKeyPoint::compute3D(), vpMbtFaceDepthNormal::computeInteractionMatrix(), vpMbtFaceDepthDense::computeInteractionMatrixAndResidu(), computeZ(), vpMbtFaceDepthNormal::displayFeature(), vpMbtFaceDepthNormal::estimateFeatures(), vpMbtFaceDepthNormal::estimatePlaneEquationSVD(), vpMbtFaceDepthNormal::getFeaturesForDisplay(), init(), rayIntersection(), and vpPlane().
|
inline |
Definition at line 104 of file vpPlane.h.
Referenced by vpMbTracker::addPolygon(), vpMbTracker::addProjectionErrorPolygon(), vpMbtDistanceCircle::buildFrom(), vpKeyPoint::compute3D(), vpMbtFaceDepthNormal::computeInteractionMatrix(), vpMbtFaceDepthDense::computeInteractionMatrixAndResidu(), computeZ(), vpMbtFaceDepthNormal::displayFeature(), vpMbtFaceDepthNormal::estimateFeatures(), vpMbtFaceDepthNormal::estimatePlaneEquationSVD(), vpMbtFaceDepthNormal::getFeaturesForDisplay(), init(), rayIntersection(), and vpPlane().
|
inline |
Definition at line 106 of file vpPlane.h.
Referenced by vpKeyPoint::compute3D(), vpMbtFaceDepthNormal::computeInteractionMatrix(), vpMbtFaceDepthDense::computeInteractionMatrixAndResidu(), computeZ(), vpMbtFaceDepthNormal::estimateFeatures(), vpMbtFaceDepthNormal::estimatePlaneEquationSVD(), getIntersection(), init(), vpMbtFaceDepthNormal::planeIsInvalid(), rayIntersection(), and vpPlane().
double vpPlane::getIntersection | ( | const vpColVector & | M1, |
vpColVector & | H | ||
) | const |
Definition at line 361 of file vpPlane.cpp.
References getD().
vpColVector vpPlane::getNormal | ( | ) | const |
Return the normal to the plane.
A plane is given by the equation where (x,y,z) is a point of R^3 and (A,B,C) are the coordinates of the normal.
Definition at line 258 of file vpPlane.cpp.
void vpPlane::getNormal | ( | vpColVector & | n | ) | const |
Return the normal to the plane.
A plane is given by the equation where (x,y,z) are the coordinates of a point and is normal vector of the plane.
Definition at line 281 of file vpPlane.cpp.
References vpColVector::resize().
void vpPlane::init | ( | const vpColVector & | P, |
const vpColVector & | n | ||
) |
Initialize the plane from a point P on the plane and the normal n to the plane.
P | : A point with coordinates (x,y,z) on the plane. The size of the vector should be 3, with P[0]=x, with P[1]=y, with P[2]=z. |
n | : The normal to the plane. |
Definition at line 148 of file vpPlane.cpp.
void vpPlane::init | ( | const vpPlane & | P | ) |
void vpPlane::init | ( | const vpPoint & | P, |
const vpPoint & | Q, | ||
const vpPoint & | R, | ||
vpPlaneFrame | frame = camera_frame |
||
) |
Compute the equation of a plane given three point P, Q, R.
The normal to the plane is given by: n = PQ x PR
P,Q,R | Three points on the plane. |
frame | Indicates if the plane should be initialized from the points coordinates expressed in the camera or object frame. |
Definition at line 172 of file vpPlane.cpp.
References camera_frame, vpColVector::cross(), vpPoint::get_oX(), vpPoint::get_oY(), vpPoint::get_oZ(), vpPoint::get_X(), vpPoint::get_Y(), and vpPoint::get_Z().
Referenced by vpPlane().
Copy operator.
Definition at line 49 of file vpPlane.cpp.
Compute the coordinates of the projection of a point on the plane.
P | : point to be projected on the plane |
Pproj | : result of the projection (pproj belongs to the plane) |
Definition at line 298 of file vpPlane.cpp.
References vpPoint::get_W(), vpPoint::get_X(), vpPoint::get_Y(), vpPoint::get_Z(), vpPoint::set_W(), vpPoint::set_X(), vpPoint::set_Y(), and vpPoint::set_Z().
double vpPlane::rayIntersection | ( | const vpPoint & | M0, |
const vpPoint & | M1, | ||
vpColVector & | H | ||
) | const |
Definition at line 315 of file vpPlane.cpp.
References vpPoint::get_X(), vpPoint::get_Y(), vpPoint::get_Z(), getA(), getB(), getC(), and getD().
|
inline |
|
inline |
Set plane parameters A, B, C, D.
|
inline |
|
inline |
|
inline |
|
friend |
Print the plane parameters as a stream like "(A,B,C,D) " where A,B,C and D correspond to the parameters of the plane.
Definition at line 414 of file vpPlane.cpp.