我正在开发一个使用OpenCV检测颜色的应用程序。到现在为止还挺好。当我在它的最后一部分上时,要在屏幕上显示图像处理的结果,会出现以下错误:
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 cvNamedWindow, file /Volumes/build-storage/build/master_iOS-mac/opencv/modules/highgui/src/window.cpp, line 593 libc++abi.dylib: terminating with uncaught exception of type cv::Exception: /Volumes/build-storage/build/master_iOS-mac/opencv/modules/highgui/src/window.cpp:593: 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 cvNamedWindow
。
据我了解的消息,错误指出(libgtk2.0-dev / pkg-config)
应该在我的计算机上进行更新/安装。好吧,该错误说明的是Windows and Linux
,而我使用的却是MacOSX
。
顺便说一句,我正在用Objective-C
对其进行编码,但在StackOverflow上仅找到了Python
个相关的问题/答案。有人可以启发我如何解决该错误吗?
下面是一段给我错误的代码。
// Above this snippet, all the image processing happens.
Mat1b mask = mask1 | mask2;
namedWindow("Mask", CV_WINDOW_AUTOSIZE);
imshow("Mask", mask);
waitKey();