cvCreateFileCapture在Arm Linux Pandaboard上导致分段错误错误

时间:2014-05-27 05:02:18

标签: linux opencv

我安装了Linux3.1.0-1282-omap4 armv71&在Opencv 2.4.9上使用霓虹灯优化pandaboard 示例代码:

int main()
{
    CvCapture* capture = cvCreateFileCapture("C:/OpenCV2.1/samples/c/tree.avi");

    IplImage* frame = NULL;

    if(!capture)
    {
        printf("Video Not Opened\n");
        return -1;
    }

    int width = (int)cvGetCaptureProperty(capture,CV_CAP_PROP_FRAME_WIDTH);
    int height = (int)cvGetCaptureProperty(capture,CV_CAP_PROP_FRAME_HEIGHT);
    double fps = cvGetCaptureProperty(capture, CV_CAP_PROP_FPS);
    int frame_count = (int)cvGetCaptureProperty(capture,  CV_CAP_PROP_FRAME_COUNT);

    printf("Video Size = %d x %d\n",width,height);
    printf("FPS = %f\nTotal Frames = %d\n",fps,frame_count);

    while(1)
    {
        frame = cvQueryFrame(capture);

        if(!frame)
        {
            printf("Capture Finished\n");
            break;
        }

        cvShowImage("video",frame);
        cvWaitKey(10);
    }

    cvReleaseCapture(&capture);
    return 0;
}

它编译没有任何错误, 但是当我运行我的程序时,它会显示segmentation fault error

除了这一行,我还评论了所有代码:
  CvCapture* capture = cvCreateFileCapture("C:/OpenCV2.1/samples/c/tree.avi");
检查是否可能导致错误?,但它仍然会引发segmentation fault错误。

由于

0 个答案:

没有答案