VideoCapture cap;
Cap. Open (0);
Mat frame;
Cap & gt;> Frame;
Cap. Release ();
End of time will need about 1 s main consumption in the cap> Frame, could you tell me how to optimize can?
In addition, see you online camera collection and image processing can do 1 s a dozen or even dozens of picture, could you tell me how to do it is? Thank you very much!
CodePudding user response:
Hardware problem, transmission speed, and the size of the image framesCodePudding user response:
VideoCapture cap;Cap. Open (0);
The code to initialize a line
Walk the need to 1 second?? For generally desktop, this too exaggeration, generally less than 10 ms,,
CodePudding user response:
1?? The VideoCapture cap (0); Move to the outside of the loop, the statement only once;2?? Influence the resolution of the image, if use 640 x480 resolution, the time is less than 3280 greatly x2464 pixels (800 w)
3?? Videocapture default no acquisition in MJPEG compression format, resulting in a decline in frame rate
CodePudding user response:
As shown in figure is big shadow image frame rate parameters of a camera
CodePudding user response:
About 1 s a little too slow, I again each frame and add a lot of image processing, a frame from cap> Frame to the next cap & gt;> Frame is dozens of ms, cap> Frame it takes about 30 ms or so, I also in research have further optimization of spaceCodePudding user response:
The great god ever find a solution, I also encountered this problem, the VideoCapture collected 2048 x1536 frame rate is only about 20 frames