summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--video-opencv/impl-camera.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/video-opencv/impl-camera.cpp b/video-opencv/impl-camera.cpp
index 0c42e30a..dddd463f 100644
--- a/video-opencv/impl-camera.cpp
+++ b/video-opencv/impl-camera.cpp
@@ -69,6 +69,9 @@ bool cam::get_frame_()
frame_.width = mat.cols;
frame_.height = mat.rows;
frame_.stride = mat.step.p[0];
+ if (mat.step.p[0] == (unsigned)frame_.width * mat.elemSize())
+ frame_.stride = cv::Mat::AUTO_STEP;
+
frame_.channels = mat.channels();
return true;