Friday 23 March 2018

OpenCV Helloworld Trouble


Just want to quickly do an openCV helloworld:

#include <iostream>
#include <opencv2/opencv.hpp>

using namespace std;
using namespace cv;

int main()
{
Mat srcImage = imread("lena.jpg");
imshow("image",srcImage);

waitKey(0);

return 0;
}

Compile:
g++ `pkg-config opencv --cflags` opencv.cpp -o opencv `pkg-config opencv --libs` 

but I got this error:
OpenCV Error: Unspecified error (The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Carbon support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script) in cvShowImage, file /home/boris/Softwares/openCV/opencv/modules/highgui/src/window.cpp, line 611 terminate called after throwing an instance of 'cv::Exception' what(): /home/boris/Softwares/openCV/opencv/modules/highgui/src/window.cpp:611: error: (-2) The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Carbon support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script in function cvShowImage

Something is wrong with QT?

sudo apt-get install libqt4-dev
cmake -D WITH_QT=ON ..
make
sudo make install

ref:
https://stackoverflow.com/questions/14655969/opencv-error-the-function-is-not-implemented
https://blog.csdn.net/keith_bb/article/details/52864851




2 comments:

  1. Just love your article.I do always look over your website for new articles.I am recently working on an app spotify premium apk cracked thats going awesome and special thanks to you :)

    ReplyDelete