diff options
author | Wim Vriend <facetracknoir@gmail.com> | 2012-09-29 08:28:56 +0000 |
---|---|---|
committer | Wim Vriend <facetracknoir@gmail.com> | 2012-09-29 08:28:56 +0000 |
commit | 71736d2d3bf639096c3c1b51565fd4c45239e44a (patch) | |
tree | 46f9c9089d424c9b6c2238754b1fa912626737b3 /FTNoIR_Tracker_PT/ftnoir_tracker_pt.cpp | |
parent | c1c630b418256bdb385d0eaf938d4002dbd568b5 (diff) |
Unversioning local .vcproj and .sln
git-svn-id: svn+ssh://svn.code.sf.net/p/facetracknoir/code@183 19e81ba0-9b1a-49c3-bd6c-561e1906d5fb
Diffstat (limited to 'FTNoIR_Tracker_PT/ftnoir_tracker_pt.cpp')
-rw-r--r-- | FTNoIR_Tracker_PT/ftnoir_tracker_pt.cpp | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/FTNoIR_Tracker_PT/ftnoir_tracker_pt.cpp b/FTNoIR_Tracker_PT/ftnoir_tracker_pt.cpp index f6682c58..db1512cb 100644 --- a/FTNoIR_Tracker_PT/ftnoir_tracker_pt.cpp +++ b/FTNoIR_Tracker_PT/ftnoir_tracker_pt.cpp @@ -58,12 +58,13 @@ void Tracker::run() if (commands & PAUSE) continue;
commands = 0;
- float dt = time.elapsed() / 1000.0;
+ float dt = time.elapsed();
time.restart();
frame = camera.get_frame(dt);
if (!frame.empty())
{
+ qDebug()<<"processing frame";
const std::vector<cv::Vec2f>& points = point_extractor.extract_points(frame, dt, draw_frame);
point_tracker.track(points, camera.get_info().f, dt);
frame_count++;
@@ -94,7 +95,6 @@ void Tracker::apply_without_camindex(const TrackerSettings& settings) point_tracker.point_model = boost::shared_ptr<PointModel>(new PointModel(settings.M01, settings.M02));
sleep_time = settings.sleep_time;
draw_frame = settings.video_widget;
- t_MH = settings.t_MH;
}
//-----------------------------------------------------------------------------
@@ -123,7 +123,7 @@ void Tracker::refreshVideo() {
Mat frame_copy;
shared_ptr< vector<Vec2f> > points;
- //qDebug("Tracker::refreshVideo()");
+ qDebug("Tracker::refreshVideo()");
{
QMutexLocker lock(&mutex);
if (!draw_frame || frame.empty()) return;
@@ -152,6 +152,21 @@ bool Tracker::GiveHeadPoseData(THeadPoseData *data) const float rad2deg = 180.0/3.14159265;
{
QMutexLocker lock(&mutex);
+<<<<<<< .mine
+ // convert to cm
+ data->x = pose.t[0] / 10.0;
+ data->y = pose.t[1] / 10.0;
+ data->z = pose.t[2] / 10.0;
+ const Matx33f& R = pose.R;
+ data->yaw = atan2( -R(2,0), sqrt(R(0,0)*R(0,0) + R(1,0)*R(1,0)) );
+ float cos_beta = cos(data->yaw);
+ if (cos_beta != 0)
+ {
+ data->pitch = rad2deg * atan2( R(2,1)/cos_beta, R(2,2)/cos_beta);
+ data->roll = rad2deg * atan2( R(1,0)/cos_beta, R(0,0)/cos_beta);
+ }
+ data->yaw *= rad2deg;
+=======
FrameTrafo X_CM = point_tracker.get_pose();
FrameTrafo X_MH(Matx33f::eye(), t_MH);
@@ -182,6 +197,7 @@ bool Tracker::GiveHeadPoseData(THeadPoseData *data) data->yaw = rad2deg * alpha;
data->pitch = rad2deg * beta;
data->roll = rad2deg * gamma;
+>>>>>>> .r148
}
return true;
}
|