【发布时间】:2014-01-23 18:58:37
【问题描述】:
我正在尝试执行一个程序以使用 opencv 显示视频文件。程序正确编译。但是当我执行它时,我得到了错误:分段错误(核心转储)。你能找到错误吗..
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <stdlib.h>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/opencv.hpp>
#include <iostream>
#include <fstream>
#include <stdio.h>
using namespace cv;
using namespace std;
int main(int argc, char *argv[])
{
if (argc != 2)
{
printf("Usage:video\n");
return -1;
}
VideoCapture capture("Home//cuda-workspace//DisplayVideo//video_1.avi");
namedWindow("display", cv::WINDOW_AUTOSIZE);
if(!capture.isOpened())
{
printf("Failed to open the video\n");
return -1;
}
for(;;)
{
Mat frame;
capture >> frame; // get a new frame from camera
imshow("display",frame);
}
return 0;
}
【问题讨论】:
-
我们需要知道核心转储的确切位置(在哪一行)!
标签: segmentation-fault coredump