Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

while (1) { } and camera FPS

the code samples using a camera I've seen so far read:

while (1) {      
 Mat frame;
 camera >> frame;
 if (frame.empty()) break;
     imshow("Webcam", frame);
 }

How does this interact with the camera FTP rate? The loop executes (I guess) in microseconds while a standard webcam delivers about 50ftp, i.e. 1 frame in 20 msec. Does the loop somehow waits for the next frame or keeps executing the same every microsecond uselessly overloading CPU? Do I need to somehow synchronize the loop with the camera FPS?