40 #include <visp3/core/vpFeatureDisplay.h>
41 #include <visp3/core/vpPoint.h>
46 const unsigned int val_3 = 3;
47 const unsigned int val_4 = 4;
48 const unsigned int index_2 = 2;
49 const unsigned int index_3 = 3;
115 const unsigned int index_0 = 0;
116 const unsigned int index_1 = 1;
117 const unsigned int index_2 = 2;
118 const unsigned int index_3 = 3;
137 const unsigned int index_0 = 0;
138 const unsigned int index_1 = 1;
139 const unsigned int index_2 = 2;
140 const unsigned int index_3 = 3;
141 const unsigned int val_3 = 3;
142 const unsigned int val_4 = 4;
144 if (oP_.
size() == val_3) {
145 oP[index_0] = oP_[index_0];
146 oP[index_1] = oP_[index_1];
147 oP[index_2] = oP_[index_2];
150 else if (oP_.
size() == val_4) {
151 oP[index_0] = oP_[index_0];
152 oP[index_1] = oP_[index_1];
153 oP[index_2] = oP_[index_2];
154 oP[index_3] = oP_[index_3];
174 const unsigned int index_0 = 0;
175 const unsigned int index_1 = 1;
176 const unsigned int index_2 = 2;
177 const unsigned int index_3 = 3;
178 const unsigned int val_3 = 3;
179 const unsigned int val_4 = 4;
181 if (oP_.size() == val_3) {
182 oP[index_0] = oP_[index_0];
183 oP[index_1] = oP_[index_1];
184 oP[index_2] = oP_[index_2];
187 else if (oP_.size() == val_4) {
188 oP[index_0] = oP_[index_0];
189 oP[index_1] = oP_[index_1];
190 oP[index_2] = oP_[index_2];
191 oP[index_3] = oP_[index_3];
202 const unsigned int index_0 = 0;
203 const unsigned int index_1 = 1;
204 const unsigned int index_2 = 2;
227 unsigned int oP_size =
oP.
size();
228 for (
unsigned int i = 0; i < oP_size; ++i) {
251 const unsigned int val_3 = 3;
252 const unsigned int index_0 = 0;
253 const unsigned int index_1 = 1;
254 const unsigned int index_2 = 2;
257 v_p[index_0] = v_cP[index_0] / v_cP[index_2];
258 v_p[index_1] = v_cP[index_1] / v_cP[index_2];
272 const unsigned int val_4 = 4;
273 const unsigned int index_0 = 0;
274 const unsigned int index_1 = 1;
275 const unsigned int index_2 = 2;
276 const unsigned int index_3 = 3;
277 v_cP.
resize(val_4,
false);
279 v_cP[index_0] = (cMo[index_0][index_0] *
oP[index_0]) + (cMo[index_0][index_1] *
oP[index_1]) + (cMo[index_0][index_2] *
oP[index_2]) + (cMo[index_0][index_3] *
oP[index_3]);
280 v_cP[index_1] = (cMo[index_1][index_0] *
oP[index_0]) + (cMo[index_1][index_1] *
oP[index_1]) + (cMo[index_1][index_2] *
oP[index_2]) + (cMo[index_1][index_3] *
oP[index_3]);
281 v_cP[index_2] = (cMo[index_2][index_0] *
oP[index_0]) + (cMo[index_2][index_1] *
oP[index_1]) + (cMo[index_2][index_2] *
oP[index_2]) + (cMo[index_2][index_3] *
oP[index_3]);
282 v_cP[index_3] = (cMo[index_3][index_0] *
oP[index_0]) + (cMo[index_3][index_1] *
oP[index_1]) + (cMo[index_3][index_2] *
oP[index_2]) + (cMo[index_3][index_3] *
oP[index_3]);
284 double d = 1 / v_cP[index_3];
301 const unsigned int index_0 = 0;
302 const unsigned int index_1 = 1;
303 const unsigned int index_2 = 2;
304 const unsigned int index_3 = 3;
305 double X = (cMo[index_0][index_0] *
oP[index_0]) + (cMo[index_0][index_1] *
oP[index_1]) + (cMo[index_0][index_2] *
oP[index_2]) + (cMo[index_0][index_3] *
oP[index_3]);
306 double Y = (cMo[index_1][index_0] *
oP[index_0]) + (cMo[index_1][index_1] *
oP[index_1]) + (cMo[index_1][index_2] *
oP[index_2]) + (cMo[index_1][index_3] *
oP[index_3]);
307 double Z = (cMo[index_2][index_0] *
oP[index_0]) + (cMo[index_2][index_1] *
oP[index_1]) + (cMo[index_2][index_2] *
oP[index_2]) + (cMo[index_2][index_3] *
oP[index_3]);
308 double W = (cMo[index_3][index_0] *
oP[index_0]) + (cMo[index_3][index_1] *
oP[index_1]) + (cMo[index_3][index_2] *
oP[index_2]) + (cMo[index_3][index_3] *
oP[index_3]);
336 const vpColor &color,
unsigned int thickness)
340 const unsigned int index_2 = 2;
342 if (v_cP[index_2] < 0) {
362 const vpColor &color,
unsigned int thickness)
366 const unsigned int index_2 = 2;
368 if (v_cP[index_2] < 0) {
385 unsigned int thickness)
399 unsigned int thickness)
440 const unsigned int index_0 = 0;
441 const unsigned int index_1 = 1;
442 const unsigned int index_2 = 2;
443 double d = 1 /
cP[index_2];
444 p[index_0] =
cP[index_0] * d;
445 p[index_1] =
cP[index_1] * d;
474 VISP_EXPORT std::ostream &
operator<<(std::ostream &os,
const vpPoint & ) {
return (os <<
"vpPoint"); }
friend std::ostream & operator<<(std::ostream &s, const vpArray2D< Type > &A)
unsigned int size() const
Return the number of elements of the 2D array.
Generic class defining intrinsic camera parameters.
Implementation of column vector and the associated operations.
void resize(unsigned int i, bool flagNullify=true)
Class to define RGB colors available for display functionalities.
error that can be emitted by ViSP classes.
@ dimensionError
Bad dimension.
static void displayPoint(double x, double y, const vpCameraParameters &cam, const vpImage< unsigned char > &I, const vpColor &color=vpColor::green, unsigned int thickness=1)
Implementation of an homogeneous matrix and operations on such kind of matrices.
Class that defines a 3D point in the object frame and allows forward projection of a 3D point in the ...
double get_oW() const
Get the point oW coordinate in the object frame.
double get_oX() const
Get the point oX coordinate in the object frame.
double get_w() const
Get the point w coordinate in the image plane.
void set_x(double x)
Set the point x coordinate in the image plane.
void set_W(double cW)
Set the point cW coordinate in the camera frame.
void set_oW(double oW)
Set the point oW coordinate in the object frame.
double get_y() const
Get the point y coordinate in the image plane.
double get_Y() const
Get the point cY coordinate in the camera frame.
double get_oZ() const
Get the point oZ coordinate in the object frame.
void set_oY(double oY)
Set the point oY coordinate in the object frame.
void set_X(double cX)
Set the point cX coordinate in the camera frame.
double get_x() const
Get the point x coordinate in the image plane.
double get_W() const
Get the point cW coordinate in the camera frame.
void set_Y(double cY)
Set the point cY coordinate in the camera frame.
void init() VP_OVERRIDE
Basic construction.
double get_Z() const
Get the point cZ coordinate in the camera frame.
void display(const vpImage< unsigned char > &I, const vpCameraParameters &cam, const vpColor &color=vpColor::green, unsigned int thickness=1) VP_OVERRIDE
void set_oZ(double oZ)
Set the point oZ coordinate in the object frame.
vpColVector getWorldCoordinates(void)
void set_Z(double cZ)
Set the point cZ coordinate in the camera frame.
vpPoint * duplicate() const VP_OVERRIDE
For memory issue (used by the vpServo class only).
void set_oX(double oX)
Set the point oX coordinate in the object frame.
double get_oY() const
Get the point oY coordinate in the object frame.
void projection() VP_OVERRIDE
void changeFrame(const vpHomogeneousMatrix &cMo, vpColVector &cP) const VP_OVERRIDE
double get_X() const
Get the point cX coordinate in the camera frame.
vpPoint()
Basic constructor.
void setWorldCoordinates(double oX, double oY, double oZ)
void set_y(double y)
Set the point y coordinate in the image plane.
void set_w(double w)
Set the point w coordinate in the image plane.