39#include <visp3/core/vpFeatureDisplay.h>
40#include <visp3/core/vpPoint.h>
45 const unsigned int val_3 = 3;
46 const unsigned int val_4 = 4;
47 const unsigned int index_2 = 2;
48 const unsigned int index_3 = 3;
118 const unsigned int index_0 = 0;
119 const unsigned int index_1 = 1;
120 const unsigned int index_2 = 2;
121 const unsigned int index_3 = 3;
140 const unsigned int index_0 = 0;
141 const unsigned int index_1 = 1;
142 const unsigned int index_2 = 2;
143 const unsigned int index_3 = 3;
144 const unsigned int val_3 = 3;
145 const unsigned int val_4 = 4;
147 if (oP_.
size() == val_3) {
148 oP[index_0] = oP_[index_0];
149 oP[index_1] = oP_[index_1];
150 oP[index_2] = oP_[index_2];
153 else if (oP_.
size() == val_4) {
154 oP[index_0] = oP_[index_0];
155 oP[index_1] = oP_[index_1];
156 oP[index_2] = oP_[index_2];
157 oP[index_3] = oP_[index_3];
177 const unsigned int index_0 = 0;
178 const unsigned int index_1 = 1;
179 const unsigned int index_2 = 2;
180 const unsigned int index_3 = 3;
181 const unsigned int val_3 = 3;
182 const unsigned int val_4 = 4;
184 if (oP_.size() == val_3) {
185 oP[index_0] = oP_[index_0];
186 oP[index_1] = oP_[index_1];
187 oP[index_2] = oP_[index_2];
190 else if (oP_.size() == val_4) {
191 oP[index_0] = oP_[index_0];
192 oP[index_1] = oP_[index_1];
193 oP[index_2] = oP_[index_2];
194 oP[index_3] = oP_[index_3];
205 const unsigned int index_0 = 0;
206 const unsigned int index_1 = 1;
207 const unsigned int index_2 = 2;
230 unsigned int oP_size =
oP.size();
231 for (
unsigned int i = 0; i < oP_size; ++i) {
254 const unsigned int val_3 = 3;
255 const unsigned int index_0 = 0;
256 const unsigned int index_1 = 1;
257 const unsigned int index_2 = 2;
260 v_p[index_0] = v_cP[index_0] / v_cP[index_2];
261 v_p[index_1] = v_cP[index_1] / v_cP[index_2];
275 const unsigned int val_4 = 4;
276 const unsigned int index_0 = 0;
277 const unsigned int index_1 = 1;
278 const unsigned int index_2 = 2;
279 const unsigned int index_3 = 3;
280 v_cP.
resize(val_4,
false);
282 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]);
283 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]);
284 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]);
285 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]);
287 double d = 1 / v_cP[index_3];
304 const unsigned int index_0 = 0;
305 const unsigned int index_1 = 1;
306 const unsigned int index_2 = 2;
307 const unsigned int index_3 = 3;
308 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]);
309 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]);
310 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]);
311 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]);
339 const vpColor &color,
unsigned int thickness)
343 const unsigned int index_2 = 2;
345 if (v_cP[index_2] < 0) {
365 const vpColor &color,
unsigned int thickness)
369 const unsigned int index_2 = 2;
371 if (v_cP[index_2] < 0) {
388 unsigned int thickness)
402 unsigned int thickness)
443 const unsigned int index_0 = 0;
444 const unsigned int index_1 = 1;
445 const unsigned int index_2 = 2;
446 double d = 1 /
cP[index_2];
447 p[index_0] =
cP[index_0] * d;
448 p[index_1] =
cP[index_1] * d;
505 os <<
"cP=(" << vpp.
get_X() <<
", " << vpp.
get_Y() <<
", " << vpp.
get_Z() <<
", " << vpp.
get_W() <<
")\n";
506 os <<
"ip=(" << vpp.
get_x() <<
", " << vpp.
get_y() <<
", " << vpp.
get_w()<<
")";
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.
Definition of the vpImage class member functions.
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.
friend VISP_EXPORT std::ostream & operator<<(std::ostream &os, const vpPoint &vpp)
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.