diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2014-01-04 13:26:04 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2014-01-04 13:26:04 +0100 |
commit | b66bf8bccc9a52d8c24763010567da8c083c482e (patch) | |
tree | 23c59f9280925578a4e7a6b8198cf1783bce0828 /FTNoIR_Tracker_PT/ftnoir_tracker_pt.cpp | |
parent | 58b4133cc98701b630286e53e37d4b540d9436f2 (diff) |
PT: remove sleep interval
The rationale is that camera blocks while the frame's being retrieved anyway.
Diffstat (limited to 'FTNoIR_Tracker_PT/ftnoir_tracker_pt.cpp')
-rw-r--r-- | FTNoIR_Tracker_PT/ftnoir_tracker_pt.cpp | 43 |
1 files changed, 20 insertions, 23 deletions
diff --git a/FTNoIR_Tracker_PT/ftnoir_tracker_pt.cpp b/FTNoIR_Tracker_PT/ftnoir_tracker_pt.cpp index fad53d60..e8bc7208 100644 --- a/FTNoIR_Tracker_PT/ftnoir_tracker_pt.cpp +++ b/FTNoIR_Tracker_PT/ftnoir_tracker_pt.cpp @@ -70,31 +70,28 @@ void Tracker::run() bool new_frame;
forever
{
- {
- QMutexLocker lock(&mutex);
-
- if (commands & ABORT) break;
- if (commands & PAUSE) continue;
- commands = 0;
-
- dt = time.elapsed() / 1000.0;
- time.restart();
-
- new_frame = camera.get_frame(dt, &frame);
- if (new_frame && !frame.empty())
- {
- frame = frame_rotation.rotate_frame(frame);
- const std::vector<cv::Vec2f>& points = point_extractor.extract_points(frame, dt, has_observers());
- tracking_valid = point_tracker.track(points, camera.get_info().f, dt);
- video_widget->update_image(frame.clone());
- }
+ QMutexLocker lock(&mutex);
+
+ if (commands & ABORT) break;
+ if (commands & PAUSE) continue;
+ commands = 0;
+
+ dt = time.elapsed() / 1000.0;
+ time.restart();
+
+ new_frame = camera.get_frame(dt, &frame);
+ if (new_frame && !frame.empty())
+ {
+ frame = frame_rotation.rotate_frame(frame);
+ const std::vector<cv::Vec2f>& points = point_extractor.extract_points(frame, dt, has_observers());
+ tracking_valid = point_tracker.track(points, camera.get_info().f, dt);
+ video_widget->update_image(frame.clone());
+ }
#ifdef PT_PERF_LOG
- log_stream<<"dt: "<<dt;
- if (!frame.empty()) log_stream<<" fps: "<<camera.get_info().fps;
- log_stream<<"\n";
+ log_stream<<"dt: "<<dt;
+ if (!frame.empty()) log_stream<<" fps: "<<camera.get_info().fps;
+ log_stream<<"\n";
#endif
- }
- msleep(s.sleep_time);
}
qDebug()<<"Tracker:: Thread stopping";
|