From 319dbd2eb74e77ac1c50048d3b6bd20fad604887 Mon Sep 17 00:00:00 2001 From: edgarriba Date: Wed, 30 Jul 2014 12:53:43 +0200 Subject: [PATCH] Code tutorial --- .../real_time_pose_estimation/include/Model.h | 54 ++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 samples/cpp/tutorial_code/calib3d/real_time_pose_estimation/include/Model.h diff --git a/samples/cpp/tutorial_code/calib3d/real_time_pose_estimation/include/Model.h b/samples/cpp/tutorial_code/calib3d/real_time_pose_estimation/include/Model.h new file mode 100644 index 0000000..79af18f --- /dev/null +++ b/samples/cpp/tutorial_code/calib3d/real_time_pose_estimation/include/Model.h @@ -0,0 +1,54 @@ +/* + * Model.h + * + * Created on: Apr 9, 2014 + * Author: edgar + */ + +#ifndef MODEL_H_ +#define MODEL_H_ + +#include +#include +#include + +class Model +{ +public: + Model(); + virtual ~Model(); + + std::vector get_points2d_in() const { return list_points2d_in_; } + std::vector get_points2d_out() const { return list_points2d_out_; } + std::vector get_points3d() const { return list_points3d_in_; } + std::vector get_keypoints() const { return list_keypoints_; } + cv::Mat get_descriptors() const { return descriptors_; } + int get_numDescriptors() const { return descriptors_.rows; } + + + void add_correspondence(const cv::Point2f &point2d, const cv::Point3f &point3d); + void add_outlier(const cv::Point2f &point2d); + void add_descriptor(const cv::Mat &descriptor); + void add_keypoint(const cv::KeyPoint &kp); + + + void save(const std::string path); + void load(const std::string path); + + +private: + /** The current number of correspondecnes */ + int n_correspondences_; + /** The list of 2D points on the model surface */ + std::vector list_keypoints_; + /** The list of 2D points on the model surface */ + std::vector list_points2d_in_; + /** The list of 2D points outside the model surface */ + std::vector list_points2d_out_; + /** The list of 3D points on the model surface */ + std::vector list_points3d_in_; + /** The list of 2D points descriptors */ + cv::Mat descriptors_; +}; + +#endif /* OBJECTMODEL_H_ */ -- 2.7.4