The VideoCapture is slow on the USB Camera. Can anybody help?
code is similar to this:
#include <iostream>
#include <opencv2//opencv.hpp>
//#include<windows.h>
using namespace cv;
int main()
{
Mat frame;
VideoCapture cap(0, cv::CAP_ANY);
//Sleep(300)
cap >> frame;
imshow("CAMERA 1", frame);
waitKey(0);
return 0;
}
so I cannot directly run VideoCapture. I can only run with the Sleep(300) with a USB camera. However, I can run it properly with the computer’s camera. What is the problem?
If I read a single frame it will read a blank image.
The only solution is to sleep(300) before cap >> frame and it will run normally. That is what I mean “slow”.