summaryrefslogtreecommitdiffhomepage
path: root/tracker-pt/camera.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tracker-pt/camera.cpp')
-rw-r--r--tracker-pt/camera.cpp13
1 files changed, 4 insertions, 9 deletions
diff --git a/tracker-pt/camera.cpp b/tracker-pt/camera.cpp
index ff721557..600ab26a 100644
--- a/tracker-pt/camera.cpp
+++ b/tracker-pt/camera.cpp
@@ -110,19 +110,14 @@ bool CVCamera::_get_frame(cv::Mat* frame)
{
if (cap && cap->isOpened())
{
- cv::Mat img;
- for (int i = 0; i < 100 && !cap->read(img); i++)
+ for (int i = 0; i < 100 && !cap->read(*frame); i++)
;;
- if (img.empty())
+ if (frame->empty())
return false;
- if (frame->rows != img.rows || frame->cols != img.cols)
- *frame = cv::Mat();
-
- *frame = img;
- cam_info.res_x = img.cols;
- cam_info.res_y = img.rows;
+ cam_info.res_x = frame->cols;
+ cam_info.res_y = frame->rows;
return true;
}
return false;