From 3921bf36d40ed83bb0690f24b0b480ed618f1a88 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Wed, 20 Mar 2019 10:25:20 +0100 Subject: tracker/pt: get rid of magic constant --- tracker-pt/module/camera.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'tracker-pt/module') diff --git a/tracker-pt/module/camera.cpp b/tracker-pt/module/camera.cpp index 687f5bff..a17aaffb 100644 --- a/tracker-pt/module/camera.cpp +++ b/tracker-pt/module/camera.cpp @@ -138,6 +138,9 @@ bool Camera::get_frame_(cv::Mat& img) auto [ frame, ret ] = cap->get_frame(); if (ret) { + int stride = frame.stride; + if (stride == 0) + stride = cv::Mat::AUTO_STEP; img = cv::Mat(frame.height, frame.width, CV_8UC(frame.channels), (void*)frame.data, frame.stride); return true; } -- cgit v1.2.3