OpenCV Problems after upgrading UBUNTU

asked 2014-07-30 01:32:44 -0500

luisruiz gravatar image

updated 2014-07-31 04:38:41 -0500

Hello,

I updated Ubuntu from 13.04 to 14.04.

I am using OpenCV 2.4.9 installed from source with:

sudo cmake -D WITH_OPENNI=ON -D WITH_QT=ON -D WITH_TBB=ON -D WITH_V4L=ON -D WITH_FFMPEG=ON -D BUILD_EXAMPLES=ON -D BUILD_DOCS=ON -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local/opencv-2.4.9 ..

I am using one of the sample programs: video_dmtx.cpp. I am using it with a camera.

I can see a video but before the program starts to stream the video I get the following error:

CvCapture_OpenNI::CvCapture_OpenNI : Failed to open input file (0): Bad file extension

I think the program is trying to use the OpenNI function instead of the normal one (if there is a normal one :P). Is there a way to tell the program not to use OpenNI unless specified??? or that is the expected behavior????

EDIT 1

Also when I tried to set video properties the program crashes, I am defining the video as:

VideoCapture capture;

And then to set the properties:

capture.set(CV_CAP_PROP_FRAME_WIDTH,  640 );
capture.set(CV_CAP_PROP_FRAME_HEIGHT, 480 );
capture.set(CV_CAP_PROP_FPS,          30 );

Edit 2

I reinstalled OpenCV with

sudo cmake -D BUILD_DOCS=ON -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local/opencv-2.4.9 ..

The program still crashes when setting properties so I commented that out.

Now I have this whenever I try to capture a frame from video:

GStreamer Plugin: Embedded video playback halted; module source reported: Could not read from resource.

Edit 3

Now it seems to be working.

My PC only has USB 3.0 ports (is a GIGABYTE BRIX) which were working OK before the upgrade, now I am using the camera through a USB 2.0 hub.

Also, before the upgrade I was using OpenCV from ROS, but now in 14.04 with ROS Indigo that is not possible.

When calling a video I had to input:

/dev/video0

But now with the OpenCV installation from source I only HAVE/MUST give the number 0, why???

Thanks!! --Luis

edit retag flag offensive close merge delete

Comments

If you built OpenCV with openNI capability, and there is an openNI device connected to your system, it will automatically use that function. Disabling that will probably mean you will have to edit the source code. As to crashing and not being able to load, could it be you are using an old gstreamer package? did you update your system to the latest releases?

StevenPuttemans gravatar imageStevenPuttemans ( 2014-07-30 03:24:52 -0500 )edit