diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2017-03-01 20:35:16 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2017-03-01 20:35:16 +0100 |
commit | 77cf9ec80947da8d82f8a9d514c98595765454d6 (patch) | |
tree | 29d91493b5a1ff2361092dbc2ec1f9eb7dd365aa /tracker-pt/ftnoir_tracker_pt.cpp | |
parent | 303c83792cd034fc2bf40e71edde968c22df5324 (diff) |
tracker/pt: don't crash in cv::resize
next hotfix or bust
Diffstat (limited to 'tracker-pt/ftnoir_tracker_pt.cpp')
-rw-r--r-- | tracker-pt/ftnoir_tracker_pt.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/tracker-pt/ftnoir_tracker_pt.cpp b/tracker-pt/ftnoir_tracker_pt.cpp index 6110e22e..5c3e338a 100644 --- a/tracker-pt/ftnoir_tracker_pt.cpp +++ b/tracker-pt/ftnoir_tracker_pt.cpp @@ -71,10 +71,10 @@ void Tracker_PT::run() new_frame = camera.get_frame(dt, frame, cam_info); } - cv::resize(frame, preview_frame, cv::Size(preview_size.width(), preview_size.height()), 0, 0, cv::INTER_NEAREST); - - if (new_frame && !frame.empty()) + if (new_frame) { + cv::resize(frame, preview_frame, cv::Size(preview_size.width(), preview_size.height()), 0, 0, cv::INTER_NEAREST); + point_extractor.extract_points(frame, preview_frame, points); point_count = points.size(); @@ -154,8 +154,12 @@ void Tracker_PT::apply_settings() void Tracker_PT::start_tracker(QFrame* video_frame) { - video_frame->setAttribute(Qt::WA_NativeWindow); + //video_frame->setAttribute(Qt::WA_NativeWindow); preview_size = video_frame->size(); + + preview_frame = cv::Mat(video_frame->height(), video_frame->width(), CV_8UC3); + preview_frame.setTo(cv::Scalar(0, 0, 0)); + video_widget = qptr<cv_video_widget>(video_frame); layout = qptr<QHBoxLayout>(video_frame); layout->setContentsMargins(0, 0, 0, 0); |