48 #include <visp3/core/vpConvert.h> 50 #if (VISP_HAVE_OPENCV_VERSION >= 0x020101) 58 vpImagePoint vpConvert::keyPointToVpImagePoint(
const cv::KeyPoint &keypoint)
85 vpPoint vpConvert::point3fToVpObjectPoint(
const cv::Point3f &point3f)
101 vpPoint vpConvert::point3fToVpCamPoint(
const cv::Point3f &point3f)
117 vpPoint vpConvert::point3dToVpObjectPoint(
const cv::Point3d &point3d)
133 vpPoint vpConvert::point3dToVpCamPoint(
const cv::Point3d &point3d)
149 cv::Point2f vpConvert::vpImagePointToPoint2f(
const vpImagePoint &point)
151 return cv::Point2f((
float)point.
get_u(), (float)point.
get_v());
160 cv::Point2d vpConvert::vpImagePointToPoint2d(
const vpImagePoint &point)
162 return cv::Point2d(point.
get_u(), point.
get_v());
172 cv::Point3f vpConvert::vpCamPointToPoint3f(
const vpPoint &point)
174 return cv::Point3f((
float)point.
get_X(), (float)point.
get_Y(), (float)point.
get_Z());
184 cv::Point3d vpConvert::vpCamPointToPoint3d(
const vpPoint &point)
196 cv::Point3f vpConvert::vpObjectPointToPoint3f(
const vpPoint &point)
198 return cv::Point3f((
float)point.
get_oX(), (float)point.
get_oY(), (float)point.
get_oZ());
208 cv::Point3d vpConvert::vpObjectPointToPoint3d(
const vpPoint &point)
219 int vpConvert::dMatchToTrainIndex(
const cv::DMatch &match) {
return match.trainIdx; }
252 to = point3fToVpCamPoint(from);
254 to = point3fToVpObjectPoint(from);
268 to = point3dToVpCamPoint(from);
270 to = point3dToVpObjectPoint(from);
281 to.resize(from.size());
282 std::transform(from.begin(), from.end(), to.begin(), keyPointToVpImagePoint);
292 to.resize(from.size());
293 std::transform(from.begin(), from.end(), to.begin(), point2fToVpImagePoint);
303 to.resize(from.size());
304 std::transform(from.begin(), from.end(), to.begin(), point2dToVpImagePoint);
315 const bool cameraFrame)
317 to.resize(from.size());
319 std::transform(from.begin(), from.end(), to.begin(), point3fToVpCamPoint);
321 std::transform(from.begin(), from.end(), to.begin(), point3fToVpObjectPoint);
333 const bool cameraFrame)
335 to.resize(from.size());
337 std::transform(from.begin(), from.end(), to.begin(), point3dToVpCamPoint);
339 std::transform(from.begin(), from.end(), to.begin(), point3dToVpObjectPoint);
355 to.resize(from.size());
356 std::transform(from.begin(), from.end(), to.begin(), dMatchToTrainIndex);
383 to = vpCamPointToPoint3f(from);
385 to = vpObjectPointToPoint3f(from);
399 to = vpCamPointToPoint3d(from);
401 to = vpObjectPointToPoint3d(from);
412 to.resize(from.size());
413 std::transform(from.begin(), from.end(), to.begin(), vpImagePointToPoint2f);
423 to.resize(from.size());
424 std::transform(from.begin(), from.end(), to.begin(), vpImagePointToPoint2d);
436 to.resize(from.size());
438 std::transform(from.begin(), from.end(), to.begin(), vpCamPointToPoint3f);
440 std::transform(from.begin(), from.end(), to.begin(), vpObjectPointToPoint3f);
453 to.resize(from.size());
455 std::transform(from.begin(), from.end(), to.begin(), vpCamPointToPoint3d);
457 std::transform(from.begin(), from.end(), to.begin(), vpObjectPointToPoint3d);
460 #elif !defined(VISP_BUILD_SHARED_LIBS) 463 void dummy_vpConvert(){};
void set_oZ(const double oZ)
Set the point Z coordinate in the object frame.
double get_oY() const
Get the point Y coordinate in the object frame.
void set_X(const double X)
Set the point X coordinate in the camera frame.
Class that defines what is a point.
static void convertToOpenCV(const vpImagePoint &from, cv::Point2f &to)
void set_oW(const double oW)
Set the point W coordinate in the object frame.
void set_Z(const double Z)
Set the point Z coordinate in the camera frame.
void set_W(const double W)
Set the point W coordinate in the camera frame.
double get_oZ() const
Get the point Z coordinate in the object frame.
void set_oX(const double oX)
Set the point X coordinate in the object frame.
void set_Y(const double Y)
Set the point Y coordinate in the camera frame.
double get_Y() const
Get the point Y coordinate in the camera frame.
double get_Z() const
Get the point Z coordinate in the camera frame.
double get_oX() const
Get the point X coordinate in the object frame.
void set_oY(const double oY)
Set the point Y coordinate in the object frame.
Class that defines a 2D point in an image. This class is useful for image processing and stores only ...
double get_X() const
Get the point X coordinate in the camera frame.
static void convertFromOpenCV(const cv::KeyPoint &from, vpImagePoint &to)