Ask Your Question
0

Run Asus Xtion with HighGUI - HOWTO?!

asked 2013-10-01 07:32:01 -0600

MikeStrike gravatar image

updated 2013-10-01 07:36:35 -0600

berak gravatar image

Hi,

I am trying to make the Asus Xtion pro live work with my computer. I am using ubuntu 12.04 with Opencv 2.4.6.1. I have been trying this for quite some time now but I cannot make it work.

I downloaded the the tools from http://www.asus.com/Multimedia/Xtion_PRO_LIVE/#support_Download_5 a. PrimeSense Software Package 20.4.2.20 : 1. OpenNI Framework (Version 1.5.2.23) 2. Sensor DDK (version 5.1.0.41) 3. NITE (version 1.5.2.21) 4. USB driver (version 3.1.3.1)

Then I followed the installation instructions and tried to run the Xtion in NiViewer, which works fine. After that I wanted to make the example code on http://docs.opencv.org/doc/user_guide/ug_highgui.html run.

But when I try to run the code, I get the the error Message "Can not open a capture object", which is cause by

if( isVideoReading )
        capture.open( filename );
    else
        capture.open(CV_CAP_OPENNI );

    cout << "done." << endl;

    if( !capture.isOpened() )
    {
        cout << "Can not open a capture object." << endl;
        return -1;
    }

This is what is mentioned in 2. on http://docs.opencv.org/doc/user_guide/ug_highgui.html. How can I change the CMake variables in Codeblocks? I have no CMakeLists.txt as I just created an empty project and added a .cpp file.

Thanks!

edit retag flag offensive close merge delete

Comments

first, make a quick test, to see if openni support was built into your cv libs:

cout << cv::getBuildInformation() << endl;

if not so, you have to rebuild opencv using cmake. like in 2.

" I have no CMakeLists.txt as I just created an empty project and added a .cpp file."

yea, all that is about rebuilding opencv, not your test-program

berak gravatar imageberak ( 2013-10-01 07:44:08 -0600 )edit

Thanks for the quick reply! BuildInformation() gave me the following: with getBuildInformation()

Video I/O: OpenNI: NO OpenNI PrimeSensor Modules: NO

sorry for the stupid question, but does that mean it is not supported or just no activated? And when I reinstall opencv, do I have to uninstall the current version first or can I just rebuild it using cmake?

MikeStrike gravatar imageMikeStrike ( 2013-10-01 08:08:04 -0600 )edit
1

"does that mean is is not supported or just no activated?" - not activated, you'll have to rebuild.

"do I have to uninstall the current version first ?" if you did not build it yourself, - probably.

berak gravatar imageberak ( 2013-10-01 08:16:46 -0600 )edit

thank you very much! It works now :).

MikeStrike gravatar imageMikeStrike ( 2013-10-02 08:38:43 -0600 )edit

hey, cool ;)

berak gravatar imageberak ( 2013-10-02 08:47:10 -0600 )edit

1 answer

Sort by » oldest newest most voted
0

answered 2015-07-27 11:04:14 -0600

lakehanne gravatar image

Put this debugging line, cout << cv::getBuildInformation() << endl;, in your code, right before

if( !capture.isOpened() )
{
    cout << "Can not open a capture object." << endl;
    return -1;
}

That will let you know if your opencv is installed with openni. If switches,

OpenNI:                      YES (ver 1.5.4, build 0)
OpenNI PrimeSensor Modules:  YES (/usr/lib/libXnCore.so)

are NO in your case, then you might want to consider recompiling your opencv modules with the cmake flag -D WITH_OPENNI=ON.

Cheers!

edit flag offensive delete link more

Question Tools

Stats

Asked: 2013-10-01 07:32:01 -0600

Seen: 1,957 times

Last updated: May 19 '14