0
$\begingroup$

Rosanswers logo

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.


Originally posted by dkst on ROS Answers with karma: 21 on 2011-06-05

Post score: 2


Original comments

Comment by Yongqiang Gao on 2011-06-11:
Hi, dkst, have u solved this problem yet? I go through this problem, and have no idea about it. I reinstall my ROS, but it also doesn't work.

Comment by Julius on 2011-06-07:
Do you have an isolated test case that runs properly when linked against your manually compiled OpenCV libraries works, and does not work if linked against the pre-built OpenCV libraries in Diamondback? That would be pretty strange. Did you check out OpenCV 2.2 from branches/2.2 in revision 5206?

$\endgroup$

3 Answers 3

0
$\begingroup$

Rosanswers logo

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.


Originally posted by James Bowman with karma: 136 on 2011-06-20

This answer was ACCEPTED on the original site

Post score: 2


Original comments

Comment by Brian Gerkey on 2011-06-20:
See also: https://code.ros.org/trac/ros-pkg/ticket/4980

$\endgroup$
0
$\begingroup$

Rosanswers logo

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?


Originally posted by Yongqiang Gao with karma: 133 on 2011-06-08

This answer was NOT ACCEPTED on the original site

Post score: 1


Original comments

Comment by Leyonce on 2014-03-30:
I would have surely used this Idea if the others didn't work.Thanks

$\endgroup$
0
$\begingroup$

Rosanswers logo

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 libopencv* ./

Hopefully ros will get this sorted out soon, but this fix is working for me at the moment.


Originally posted by nicktheanimal25 with karma: 11 on 2011-06-12

This answer was NOT ACCEPTED on the original site

Post score: 1


Original comments

Comment by Yongqiang Gao on 2011-06-12:
I have just solved with this problem. For ROS originally doesn't support ffmpeg, we should turn on those flags at Makefile in "Opencv2" in "vision_opencv" , and then rebuild it. By the way, if ros in /opt/, it doesn't rebuild very well, so I copy "vision_opencv" into my "~/". Hope for helping u.

Comment by Leyonce on 2014-03-30:
Cool pal.That's so cool.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.