1 | initial version |
Probably the line video_cap.set(CV_CAP_PROP_FOCUS, 14);
inside the loop cause the memory leak, you need to set the capture property only at once like,
cv::Mat img;
cv::VideoCapture video_cap(0);
video_cap.set(CV_CAP_PROP_FOCUS, 14);
for(int i = 0; i < 1000; ++i)
{
video_cap >> img;
cv::imshow("image",img);
cv::waitKey(10);
}
2 | No.2 Revision |
Probably the line video_cap.set(CV_CAP_PROP_FOCUS, 14);
inside the loop cause the memory leak, you need to set the capture property only at once like,
cv::Mat img;
cv::VideoCapture video_cap(0);
video_cap.set(CV_CAP_PROP_FOCUS, 14);
for(int i = 0; i < 1000; ++i)
{
video_cap >> img;
cv::imshow("image",img);
cv::waitKey(10);
}
3 | No.3 Revision |
Probably the line video_cap.set(CV_CAP_PROP_FOCUS,
inside the loop cause the memory leak, here you need to set the capture property only at once like,14);14)
cv::Mat img;
cv::VideoCapture video_cap(0);
video_cap.set(CV_CAP_PROP_FOCUS, 14);
for(int i = 0; i < 1000; ++i)
{
video_cap >> img;
cv::imshow("image",img);
cv::waitKey(10);
}