Image capture from USB camera with Python
Good afternoon,
I am trying to acquire a single image from a USB camera. I can successfully visualise a live stream with the code provided in the "Getting Started with VideosĀ¶" section from the tutorial by replacing 0 with 1, but I can't figure out how to capture just a single image with this camera. I could solve the problem by just pressing print screen then saving the image but this is rather annoying, is there a way to do that by code ?
Thanks
what again is the problem ? saving the (captured) image to disk ?
Yes that's it.
a simple cv2.imwrite("my.png",frame) will do the trick.
also, opencv comes with a lot of nice samples. which are probably already on your disk.