0

I managed to compile and install opencv with OpenNI2 in Lubunutu (Arm architecture). I tested the example provided in /samples/cpp/openni_capture.cpp and it succeeds in communicating with the sensor and displaying the information about it. However, the program reaches a points just before showing the images/data and nothing happens, the program hangs in the line if(!capture.grab() .

for(;;)
{
   ...

    if( !capture.grab() )
    {
        cout << "Can not grab images." << endl;
        return -1;
    }
    else
    {
        if( retrievedImageFlags[0] && capture.retrieve( depthMap, CAP_OPENNI_DEPTH_MAP ) )
        {
            const float scaleFactor = 0.05f;
            Mat show; depthMap.convertTo( show, CV_8UC1, scaleFactor );
            imshow( "depth map", show );
        }

       ...
    }

I wrote some lines to make sure that the problem is in that function and it is, I'm quite sure. It doesn't even show the error message. Does anybody know what's going on or how to solve this? Thanks

4

1 回答 1

0

好吧,如果有人遇到同样的问题,我使用专门为 Odroid U3 (Arm) 创建的抓取器解决了这个问题,网址为http://forum.odroid.com/viewtopic.php?f=15&t=2090

基本上代码保持不变,但我没有使用 OpenCV 中的 VideoCapture 类,而是使用了上面的那个。

最后,我可以将 opencv、pcl 和 ros 与 Arm 板上的华硕传感器一起使用 =)。

干杯

于 2014-12-05T17:41:36.990 回答