Hi all, I recently updated my diamondback version to the latest version and I realised that my packages that I had written previously that used OpenCV's VideoCapture (webcam) fail to work. That is the code:
cv::VideoCapture capture;
capture.open(0);
always returns FALSE. When I compile the latest OpenCV 2.2 library outside the ROS framework and run it, my web cam is always initialised properly so I know its not a problem with OpenCV. My webcam works fine with Cheese as well so it's not at fault too. I am running Ubuntu 10.04 LTS with a full clean install of ROS Diamondback with the required vision-opencv stacks.
Has anyone else had the same experience? Or does anyone have any advice for me to take?
Thanks.
Hi all, the ROS opencv packge (opencv2) does not build the video interface options - we took this decision early because of the fragility of the OpenCV video capture and I/O code.
In use this tends not to be a problem because we usually source images via ROS, and use cv_bridge to import images (or sequences of images for video) into OpenCV.
That problem falls to me unluckily, after i arrange my older openCV libraries for trying to solve the problem that it can't open local video file.
I think it disorder the connections between vision_opencv. I haven't any constructively suggestion, except to re-install diamondback.
Anyone has some better advice?
I was having the same problem trying to use create_webcam. It looks like there is just something wrong with whatever version of opencv gets installed through the ros repositories. My quick and dirty solution was to compile/install opencv from source, and then copy all of the libraries into the ros opencv/lib directory:
$ roscd opencv2/opencv
$ sudo mv lib/ lib.orig/
$ mkdir lib
$ cd lib
$ sudo cp <path to="" opencv="" binaries="">libopencv* ./
Hopefully ros will get this sorted out soon, but this fix is working for me at the moment.
Asked: Jun 05 '11
Seen: 601 times
Last updated: Jun 20 '11
ROS Answers is licensed under Creative Commons Attribution 3.0 Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.