错误一:
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/yangkai04/project/mine/cplus/third/src/opencv/modules/highgui/src/window.cpp, line 583
terminate called after throwing an instance of 'cv::Exception'
what(): /home/yangkai04/project/mine/cplus/third/src/opencv/modules/highgui/src/window.cpp:583: 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
原因是先编译了opencv,再安装了GTK。参考了网页。
解决:我是自己编译的opencv,确认安装了gtk后(sudo apt-get install libgtk2.0-dev),重新编译后就ok了。也可以选择使用sudo apt-get install libopencv-dev命令安装的opencv。