I am trying to run this program to display a image in qtcreator with openCV2 but it is crashing with out any compile error. And when I see the debug output it says that it is a segmentation fault. I am new in openCV . Please any one help. Here is the program
> #include "opencv2/core/core.hpp" > #include "opencv2/highgui/highgui.hpp" > #include <iostream> > > using namespace std; using namespace > cv; > > int main() { > // read image > Mat image = imread("/home/avishek/Pictures/kcs_11903b52.png"); > if(image.data == NULL){ > cout<< "Can not load image" << endl; > return -1; > } > namedWindow("Image", CV_WINDOW_NORMAL); > imshow("Image", image); > waitKey(5000); > destroyAllWindows(); > return 0; }
my qtcreator version is 3.4.1 qt version is 5.4.2 and OpenCv is 3.0.0