Skip to content
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

Desired webcam resolution ... could not being set. Final resolution: ... #2328

Open
jploski opened this issue Jan 1, 2025 · 0 comments
Open

Comments

@jploski
Copy link

jploski commented Jan 1, 2025

Running openpose commit 5c5d965 on Linux with Bus 002 Device 012: ID 046d:080a Logitech, Inc. Portable Webcam C905. Setting resolution via parameter --camera_resolution 640x480 (or any other resolution) does not work. It always falls back to the highest (and lowest FPS) supported resolution (1600x1200) while displaying the error message quoted in title.

Setting the resolution works correctly after the following fix:

diff --git a/src/openpose/producer/videoCaptureReader.cpp b/src/openpose/producer/videoCaptureReader.cpp
index cd42f3b..8731d2d 100644
--- a/src/openpose/producer/videoCaptureReader.cpp
+++ b/src/openpose/producer/videoCaptureReader.cpp
@@ -150,6 +150,7 @@ namespace op
         {
             // Open webcam
             upImpl->mVideoCapture = cv::VideoCapture{index};
+            upImpl->mVideoCapture.open(index, cv::CAP_V4L2);
             // Make sure video capture was opened
             if (throwExceptionIfNoOpened && !isOpened())
                 error("VideoCapture (webcam) could not be opened.", __LINE__, __FUNCTION__, __FILE__);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant