在Mac系统下,使用Qt Creator来配置OpenCV:

在Mac系统下,使用Qt Creator来配置OpenCV:

helloCV.pro 末尾添加以下代码:
INCLUDEPATH += /usr/local/include
INCLUDEPATH += /usr/local/include/opencv
INCLUDEPATH += /usr/local/include/opencv2

LIBS += -L/usr/local/lib
-lopencv_core
-lopencv_highgui
-lopencv_imgproc
main.cpp 代码如下:
//#include “mainwindow.h”
//#include
//int main(int argc, char *argv[])
//{
// QApplication a(argc, argv);
// MainWindow w;
// w.show();
// return a.exec();
//}

#include
#include
#include
using namespace std;

#include
#include
#include
using namespace cv;

int main(int argc, char *argv[])
{
Mat src = imread("/Users/tianzhaixing/Pictures/jurassic_world.jpg");
if(src.empty())
{
cerr << “Please check the path of input image!” << endl;
return -1;
}
const string winname = “src”;
namedWindow(winname, WINDOW_AUTOSIZE);
imshow(winname, src);
waitKey(0);
destroyWindow(winname);
return 0;
}

https://blog.csdn.net/wjw498279281/article/details/80428805

修改.pro文件
向.pro文件中加入
QT_CONFIG -= no-pkg-config
CONFIG += link_pkgconfig
PKGCONFIG += opencv

推荐几篇文章:
在Mac系统下,使用Qt Creator来配置OpenCV:
https://blog.csdn.net/hero_myself/article/details/57086673
http://blog.sina.com.cn/s/blog_a980f4a60102vt6r.html
https://blog.csdn.net/computerme/article/details/52986413
https://blog.csdn.net/tianzhaixing2013/article/details/52077064
https://blog.csdn.net/wjw498279281/article/details/80428805#t7

你可能感兴趣的:(数字图像处理)