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

Opencvgrabber device enumeration camera choice by name #605

Closed
wants to merge 3 commits into
base: mm2
from

Conversation

Projects
None yet
2 participants
@bfritscher

bfritscher commented Jan 20, 2018

Although there seemed to be a camera number property after reviewing the code it did nothing as CV_CAP_ANY was hardcoded, and the camera number property ignored.
The following changes enumerate the detected cameras by name and initialise the correct camera.
Tested with China USB Camera x500 recognized as Lenovo EasyCamera on Windows 10.

@nicost

This comment has been minimized.

Collaborator

nicost commented Jan 23, 2018

Thanks! I tried to apply the patch, but it fails with:

patching file DeviceAdapters/OpenCVgrabber/DeviceEnumerator.cpp
patching file DeviceAdapters/OpenCVgrabber/DeviceEnumerator.h
patching file DeviceAdapters/OpenCVgrabber/OpenCVgrabber.cpp
Hunk #1 FAILED at 48.
Hunk #2 FAILED at 162.
Hunk #3 FAILED at 223.
Hunk #4 FAILED at 1058.
4 out of 4 hunks FAILED -- saving rejects to file DeviceAdapters/OpenCVgrabber/OpenCVgrabber.cpp.rej
patching file DeviceAdapters/OpenCVgrabber/OpenCVgrabber.h
Hunk #1 FAILED at 34.
1 out of 1 hunk FAILED -- saving rejects to file DeviceAdapters/OpenCVgrabber/OpenCVgrabber.h.rej

Also, I noted that you use the "auto" contstruct. Since we build with VS 2010, that will not compile. Can you rewrite against the code currently in the subversion repository and either commit to github or email me a patch?

@bfritscher

This comment has been minimized.

bfritscher commented Jan 23, 2018

Hi, thanks I forked the latest version from the mm2 branch on github. Is it not in sync with the subversion repository? Which tag/branch do I need to pull from subversion?
I will try to create a VM to install VS2010...

@nicost

This comment has been minimized.

Collaborator

nicost commented Jan 23, 2018

Thanks Boris! The master branch should be in sync with the subversion branch (and hardware changes get pushed into subversion, 1.4, branch first, automatically get pushed into the github master branch, and then are manually cherry-picked into the mm2 branch). No need to install VS2010 (too much work), if you could take the auto out and I can apply the patch without issues, then I can deal with remaining compilation issues. Thanks!

@bfritscher

This comment has been minimized.

bfritscher commented Jan 24, 2018

Ok thanks, after some more througbleshooting I managed to get Windows 7.1 SDK installed. See #606

@bfritscher bfritscher closed this Jan 24, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment