diff options
-rw-r--r-- | tracker-pt/pt_video_widget.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tracker-pt/pt_video_widget.cpp b/tracker-pt/pt_video_widget.cpp index 860d0a77..8c18e678 100644 --- a/tracker-pt/pt_video_widget.cpp +++ b/tracker-pt/pt_video_widget.cpp @@ -16,7 +16,13 @@ void PTVideoWidget::update_image(const cv::Mat& frame) if (!freshp) { - _frame = frame.clone(); + if (_frame.cols != frame.cols || + _frame.rows != frame.rows || + _frame.channels() != frame.channels()) + { + _frame = cv::Mat(); + } + frame.copyTo(_frame); freshp = true; } } |