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
OpenCvCamera Preferred Height and Width Fails on Linux #395
Comments
I have released a test version at http://openpnp.org/test-downloads/ that sets the value both before and after. Please test and see if this works for you. |
I can confirm the problem on a Linux AMD64 machine running Kubuntu 16.04, with a 1280x1024 Philips SPZ5000 Webcam:
Could the fact that openpnp cannot recognize a CCD Philips SPC 900NC webcam be of relevance? I'll try to run the test branch and report back. |
Thanks for checking Dimitrios.
The SPC 900NC does not appear to be a UVC device, which means it will not
be recognized. In general, only cameras that follow the UVC standard will
work. These are cameras that the OS should recognize just by plugging in,
without installing any drivers.
Jason
…On Fri, Dec 30, 2016 at 11:27 AM Dimitrios ***@***.***> wrote:
I can confirm the problem on a Linux AMD64 machine running Kubuntu 16.04,
with a 1280x1024 Philips SPZ5000 Webcam:
$ uname -a
Linux desk 4.4.0-36-generic #55-Ubuntu SMP Thu Aug 11 18:01:55 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
$ dpkg -l | grep libopencv
ii libopencv-core2.4v5:amd64 2.4.9.1+dfsg-1.5ubuntu1 amd64 computer vision core library
ii libopencv-highgui2.4v5:amd64 2.4.9.1+dfsg-1.5ubuntu1 amd64 computer vision High-level GUI and Media I/O library
ii libopencv-imgproc2.4v5:amd64 2.4.9.1+dfsg-1.5ubuntu1 amd64 computer vision Image Processing library
$ dpkg -l | grep v4l2ucp
ii v4l2ucp 2.0.2-4 amd64 Video for Linux 2 Universal Control Panel
$ java -version
openjdk version "1.8.0_111"
OpenJDK Runtime Environment (build 1.8.0_111-8u111-b14-2ubuntu0.16.04.2-b14)
OpenJDK 64-Bit Server VM (build 25.111-b14, mixed mode)
Could the fact that openpnp cannot recognize a CCD Philips SPC 900NC
webcam be of relevance?
I'll try to run the test branch and report back.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#395 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABIKcyjFUutMQWUut08aLF_1GiZ9FzPUks5rNT7xgaJpZM4LX9az>
.
|
The SPC 900NC is recognized by the OS without any driver installation, v4l2ucp control panel shows all controls,the same way it does for all other webcams, and seems to be able to control the camera. Cheeze and VLC and other multimedia/communications apps that I tried it with do recognize it and work properly. I like this CCD camera for its low light sensitivity and the absense of the rolling shutter effect, despite its mere 640x480 px resolution. |
This message seems to shed some light on why the camera is not recognized:
http://nuigroup.com/forums/viewthread/291/
If you can get the camera working with OpenCV and tell me how you did it I
will be happy to make sure it's supported. OpenCV is the limiting factor.
That's how we talk to the cameras. Unfortunately we don't have a native v4l
driver.
…On Fri, Dec 30, 2016 at 11:53 AM Dimitrios ***@***.***> wrote:
The SPC 900NC is recognized by the OS without any driver installation,
*v4l2ucp* control panel shows all controls,the same way it does for all
other webcams, and seems to be able to control the camera. Cheeze and VLC
and other multimedia/communications apps that I tried it with do recognize
it and work properly. I like this CCD camera for its low light sensitivity
and the absense of the rolling shutter effect, despite its mere 640x480 px
resolution.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#395 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABIKc8upp7FyXY_PLQZU0TCwqOJpLZc_ks5rNUTwgaJpZM4LX9az>
.
|
Thanks for giving it a thought Jason. |
Jason, I've tested the the version you released and the problem persists. Setting the resolution before or after opening the device has no effect. The only difference is that prior to opening, cap.get returns (0, 0) and after opening it returns (640.0, 480.0). I'm going to try to compile the latest opencv2 jar and use it to see if it works. I'll keep you posted. Thanks! |
Thanks for testing Carlos, let me know if you find anything.
…On Fri, Dec 30, 2016 at 1:16 PM Carlos Antunes ***@***.***> wrote:
Jason, I've tested the the version you released and the problem persists.
Setting the resolution before or after opening the device has no effect.
The only difference is that prior to opening, cap.get returns (0, 0) and
after opening it returns (640.0, 480.0). I'm going to try to compile the
latest opencv2 jar and use it to see if it works. I'll keep you posted.
Thanks!
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#395 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABIKc54C7qQ3GZ_ecRugpmbDlzJkCGXOks5rNVijgaJpZM4LX9az>
.
|
* test: Testing setting camera width and height before and after open to see if it helps with #395. # Conflicts: # src/main/java/org/openpnp/machine/reference/camera/OpenCvCamera.java
* develop: Trace open cv camera properties on initialize to make it easier to debug issues with this feature. Added a button to read the current property value on the open cv camera wizard. Adds support for setting opencv camera properties. Fixes #328. Testing setting camera width and height before and after open to see if it helps with #395. Added links to documentation in Help menu. Added support for boolean actuators in ReferenceAutoFeeder. Added support for post pick actuator in ReferenceAutoFeeder. Added post pick support to Feeders tab pick operation. Updated CHANGES.md for recent changes. Remove accidental import. Adds "Check For Updates..." menu item in Help menu. Fixes #391. Fix git config which was breaking api doc uploads. ReferenceCamera changes to fix performance issues in #392 and infinite loop: Added safeInternalCapture() which has retry on null images and returns a default image on failure, guaranteeing we never see a null image. While loops on getWidth(), getHeight(), and capture() replaced with safeInternalCapture() # Conflicts: # src/main/java/org/openpnp/machine/reference/camera/OpenCvCamera.java
Quick question: should it be enough to replace the opencv jar file and make the new dynamic opencv java lib known to the OS? I did exactly this (for the lib I set LD_LIBRARY_PATH) but OpenPnP bombs... I may be doing something wrong. Thanks! |
Carlos,
As long as you have the same version of OpenCV installed on the machine
then OpenPnP should use that before trying to use it's own. Just make sure
the exact same library filename is available in LD_LIBRARY_PATH. If you are
using the develop version of OpenPnP this will be libopencv_java2413.so.
Jason
…On Fri, Dec 30, 2016 at 4:19 PM Carlos Antunes ***@***.***> wrote:
Quick question: should it be enough to replace the opencv jar file and
make the new dynamic opencv java lib known to the OS? I did exactly this
(for the lib I set LD_LIBRARY_PATH) but OpenPnP bombs... I may be doing
something wrong. Thanks!
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#395 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABIKcx7QlcsK3P3TetrQ_wHl12uP9qDgks5rNYNmgaJpZM4LX9az>
.
|
Well, it seems the problem is that OpenCV doesn't include the nu.pattern thing... |
Carlos,
Some explanation is in order: OpenPnP does not use the opencv.jar that is
built by OpenCV. It uses https://github.com/openpnp/opencv, instead. This
is a library originally created by Pattern Consulting which I forked a long
time ago and now maintain. The purpose of this library is to bundle the
opencv.jar along with all of it's dependencies for various platforms. This
is so that I can distribute OpenPnP without users having to build and
install OpenCV externally.
The nu.pattern stuff is the loader for the included binaries. It first
tries to load the library from the OS and then if it's not found it
attempts to load one of the binaries that is included with the library.
So, as long as you have a library in your LD_LIBRARY_PATH with the same
name as the bundled one (libopencv_java2413) it should try to load that
first and use it.
Jason
…On Fri, Dec 30, 2016 at 6:15 PM Carlos Antunes ***@***.***> wrote:
Well, it seems the problem is that OpenCV doesn't include the nu.pattern
thing...
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#395 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABIKc36TQSZiPNMbGEXFNZUdQnM0dtxjks5rNZ6LgaJpZM4LX9az>
.
|
Jason, following your explanantion, I deleted libopencv_java from the jar file (to be sure) and made available my version (via LD_LIBRARY_PATH). Result was the same. There's something strange going on with the java interface. At this point, I don't see what else I can do. Thanks for your help, though! |
I was able to solve the problem with the Philips SPC 900NC CCD camera by turning on WITH_V4L and WITH_LIBV4L when running cmake. I created this opencv issue, that shows more about the process. I don't know whether it is feasible to do the same in openpnp. In the process I learned that one could also use GStramer plugins to pass video/image frames to opencv. |
Thanks for checking into this @dzach. I build and distribute OpenCV for OpenPnP, and it looks like the current build did not include V4L. You can see the results from the build here: https://github.com/openpnp/opencv/blob/v2.4.13-0/src/main/resources/nu/pattern/opencv/linux/x86_64/cmake.log#L353 I've added an issue for myself to see if I can include V4L and GStreamer in the next build: openpnp/opencv#13. I will update this ticket once I investigate further. |
* develop: (97 commits) Adds a new ScriptRun CvPipeline stage that allows for custom programming of CvPipelines. Rearranged baclash fields a bit to clean up the GcodeDriverWizard. made textfields a bit more narrow moved form elements into two grid rows documentation form and keyword fixes more blackslah compensation GUI process - still need to fix form Fixes #398: Feeder exceptions are no longer swallowed during job processing. When reporting there are no feeders available, if a feed was previously attempted we store the error and forward it on. minor fix for NaN cases initial slack compensation experiments Trace open cv camera properties on initialize to make it easier to debug issues with this feature. Added a button to read the current property value on the open cv camera wizard. Adds support for setting opencv camera properties. Fixes #328. Testing setting camera width and height before and after open to see if it helps with #395. Added links to documentation in Help menu. Added support for boolean actuators in ReferenceAutoFeeder. Added support for post pick actuator in ReferenceAutoFeeder. Added post pick support to Feeders tab pick operation. Updated CHANGES.md for recent changes. Remove accidental import. Adds "Check For Updates..." menu item in Help menu. Fixes #391. Fix git config which was breaking api doc uploads. ReferenceCamera changes to fix performance issues in #392 and infinite loop: Added safeInternalCapture() which has retry on null images and returns a default image on failure, guaranteeing we never see a null image. While loops on getWidth(), getHeight(), and capture() replaced with safeInternalCapture() ...
Closing this as "Won't Fix". Most users have transitioned to OpenPnpCaptureCamera, and I suggest that all other users do so. The OpenCV camera bindings are terrible and unmaintained, so I won't spend any further time updating them. |
User reports that no matter what preferred height and width are set to the camera always returns images at 640x480. Native resolution is 1920x1080. Report is for Debian Jessie. Says that doing the same thing with Python bindings works fine.
See discussion at https://groups.google.com/d/msgid/openpnp/CA%2BQw0jwGyRBWXpvvG%3D%2BY-UqHn_MQvS9%2B%2BvaXOjve99-T%2BCY4vg%40mail.gmail.com?utm_medium=email&utm_source=footer.
I suspect that the version of OpenCV that we're distributing is linked against a camera driver that does not handle property setting properly while his local copy of opencv does. Need to run some tests on a Linux based system.
It would be helpful if others can verify this issue. To do, follow these steps:
The text was updated successfully, but these errors were encountered: