-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OpenCVVideoCapture implementation #130
Conversation
Looks good, and seems to work perfectly with my webcam, a Zed2i as USB webcam, and an mp4 video file. Some remarks:
Command to list available resolutions and framerates of a camera:
|
Okay, I was unsure about the filename.
We can do the same as with the Realsense and Zed cameras: allow the user to select a desired resolution and FPS.
We could add a property that indicates whether the camera still has frames to produce?
This should be fairly simple to do |
@Victorlouisdg When setting the desired resolution for a webcam, OpenCV silently selects the closest match supported by the webcam. Do we want to log a warning or raise an error in this case? |
I guess we can use it with this behavior until it causes problems.
Maybe we could just return camera = OpenCVVideoCapture(("video.mp4",))
while True:
image = camera.get_rgb_image()
if image == None:
break
cv2.imwrite(image, "image.png") |
I discussed with Thomas and as we don't want to change the while True:
try:
image = camera.get_rgb_image()
except EOFError:
break
cv2.imwrite(image, "image.png") It's a bit ugly, but you only need to add that to scripts where you want to support using video files as |
Describe your changes
Implement
OpenCVVideoCapture
based on the proposal in #81Checklist