segmentation fault when imread is active [closed]

asked 2014-10-05 16:42:30 -0500


I am having a problem that is really driving me crazy. I installed opencv and cannot find out what is causing the problem. I copied sample code from the tutorials to test my installation and I get a segfault whenever I start the program.

I reduced the code to identify the cause of the problem:

#include <stdio.h>
#include <iostream>
#include "opencv2/core/core.hpp"
#include "opencv2/features2d/features2d.hpp"
#include "opencv2/highgui/highgui.hpp"
//#include "opencv2/nonfree/features2d.hpp"
#include "opencv2/nonfree/nonfree.hpp"

using namespace cv;

void readme();

/** @function main */
int main( )
    std::cout << "hello!!!" << std::endl;

  Mat img_1;

  img_1 = imread("eagle.jpg");

  int minHessian = 400;

  SurfFeatureDetector detector( minHessian );

//  std::vector<KeyPoint> keypoints_1, keypoints_2;

//  detector.detect( img_1, keypoints_1 );

  return 0;

imread seems to be the culprit. If I exclude imread("eagle.jpg") it works fine. But if I put it into the code I get a segfault once I execute the code - even before "hello!!!" is printet.

This is where the debugger stops and gives me the segfault - if anybody can read anything from that. -> (0x7fffd492cdfc <+0x0000> lock incl (%rax))

I tried to install different versions of opencv without success.

I am using Ubuntu 14.04 with Qt Creator 3.0.1 and currently opencv 2.8.3

I greatly appreciate any help!


edit retag flag offensive reopen merge delete

Closed for the following reason duplicate question by StevenPuttemans
close date 2014-10-06 04:54:54.180995


there is no opencv 2.8.3 (that is most probably your cmake version)

berak gravatar imageberak ( 2014-10-06 02:07:40 -0500 )edit