Ask Your Question
2

OpenCV VideoCapture Not Working in Diamondback?

asked Jun 05 '11

dkst gravatar image dkst
21 1 1 3

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.

Comments

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? Julius (Jun 07 '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. Yongqiang Gao (Jun 11 '11)

3 Answers

Sort by ยป oldest newest most voted
2
dkst has selected this answer as correct

answered Jun 20 '11

James Bowman gravatar image James Bowman
136 3

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.

link

Comments

0
dkst has selected this answer as correct

answered Jun 08 '11

Yongqiang Gao gravatar image Yongqiang Gao
99 1 4 18

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?

link
0
dkst has selected this answer as correct

answered Jun 12 '11

nicktheanimal25 gravatar image nicktheanimal25
1 1

updated Jun 12 '11

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.

link

Comments

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. Yongqiang Gao (Jun 12 '11)

Your answer

Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!
[hide preview]

Question tools

Follow

subscribe to rss feed

Stats

Asked: Jun 05 '11

Seen: 601 times

Last updated: Jun 20 '11