Segmentation fault when using cv::imshow
Hy guys, I am using OpenCV 3.1 with ros indigo and try to use cv::imshow to display an image. Everytime it hits imshow i get a segmentation fault. Even in the very basic programms below. The image is loaded and shows rows and cols.
#include <iostream>
#include <opencv/cv.h>
#include <opencv2/highgui/highgui.hpp>
int main(int argc, char* argv[]) {
cv::Mat img = cv::imread("frankenfurter.jpg"); //Make sure that the image is there
std::cout << img.rows << "; " << img.cols << std::endl;
cv::namedWindow("img");
cv::imshow("img", img);
cv::waitKey(2000);
return 0;
}
I am looking for hints what to do. Since I don't know what the cause of this behavior is. My ideas were maybe a problem with QT or the sublibrary that is used in imshow. Any ideas
does it show rows or cols ? most probably your image was not loaded.
do you absolutely have to use a 3rd party built (and outdated) ros installation ? we probably can't help you with specific problems aboout that
Yes I have to use indigo and opencv 3.x version to run on our hardware. Could it be that my ros installation is botchered?
how would WE know about ROS ?
if you're mainly interested about opencv, get a recent codebase, and try to build that from src