工程配置:
INCLUDEPATH +=D:\opencv\build\include
LIBS+=-LD:\opencv\build\x64\vc12\lib
-lopencv_calib3d249d
-lopencv_contrib249d
-lopencv_core249d
-lopencv_features2d249d
-lopencv_flann249d
-lopencv_gpu249d
-lopencv_highgui249d
-lopencv_imgproc249d
-lopencv_legacy249d
-lopencv_ml249d
-lopencv_nonfree249d
-lopencv_objdetect249d
-lopencv_ocl249d
-lopencv_photo249d
-lopencv_stitching249d
-lopencv_superres249d
-lopencv_ts249d
-lopencv_video249d
-lopencv_videostab249d
debug配置:
代碼:
include <QCoreApplication>
include <iostream>
include <opencv2/opencv.hpp>
using namespace std;
using namespace cv;
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
QMessageLogger *logger=new QMessageLogger;
logger->info("this is a test");
logger->info(CV_VERSION);
Mat image = imread("D:\\cctv.jpg");
cvNamedWindow("window", CV_WINDOW_NORMAL);
imshow("window",image);
cv::waitKey(5000);
return a.exec();
}