Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Capturing and saving/manipulating a single frame from a camera.

Hi there,

What I am trying to do sounds pretty basic to me, I just can't quite do it.

I saw code online showing how to connect to the camera and stream through it, so I thought, maybe I'll just take this specific frame and do something with it, but apparently that doesn't work.

I used VideoCapture cap and then cap.open to check if it can connect to it. Then, in a loop, something like this:

Mat frame; camp >> frame;

Then according to the code I found online, they refresh a window with the new frame taken every time in the loop. So I thought, as I said before, maybe I could use this one frame and whatnot. But whenever I try to show one specific frame in a window (additional window) the window is blank while the other window still shows the video.

The way I tried showing one frame is by creating another window and using imshow when I was halfway through the loop, just to be sure that the frame is fine and all.

Anyway! I just need to get one frame from this camera, that is it, how do I do it?