From 31bec459987260759e633715c676e7aad0e16157 Mon Sep 17 00:00:00 2001 From: edgarriba Date: Wed, 30 Jul 2014 12:56:46 +0200 Subject: [PATCH] Code tutorial --- .../src/ModelRegistration.cpp | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 samples/cpp/tutorial_code/calib3d/real_time_pose_estimation/src/ModelRegistration.cpp diff --git a/samples/cpp/tutorial_code/calib3d/real_time_pose_estimation/src/ModelRegistration.cpp b/samples/cpp/tutorial_code/calib3d/real_time_pose_estimation/src/ModelRegistration.cpp new file mode 100644 index 0000000000..5f39a0ffcf --- /dev/null +++ b/samples/cpp/tutorial_code/calib3d/real_time_pose_estimation/src/ModelRegistration.cpp @@ -0,0 +1,38 @@ +/* + * ModelRegistration.cpp + * + * Created on: Apr 18, 2014 + * Author: edgar + */ + +#include "ModelRegistration.h" + +ModelRegistration::ModelRegistration() +{ + n_registrations_ = 0; + max_registrations_ = 0; +} + +ModelRegistration::~ModelRegistration() +{ + // TODO Auto-generated destructor stub +} + +void ModelRegistration::registerPoint(const cv::Point2f &point2d, const cv::Point3f &point3d) + { + // add correspondence at the end of the vector + list_points2d_.push_back(point2d); + list_points3d_.push_back(point3d); + n_registrations_++; + } + +void ModelRegistration::reset() +{ + n_registrations_ = 0; + max_registrations_ = 0; + list_points2d_.clear(); + list_points3d_.clear(); +} + + +