可以发现imshow、Mat、waitkey这三个都是opencv相关的。
在添加了相关库文件后还是有问题。
#include "stdafx.h" #include <stdio.h> #include <iostream> #include "opencv2/core/core.hpp" #include "opencv2/features2d/features2d.hpp" #include "opencv2/highgui/highgui.hpp" #include <opencv2/nonfree/features2d.hpp> #include "opencv2/imgproc/imgproc.hpp" #include "opencv2/nonfree/nonfree.hpp" #include "opencv2/legacy/legacy.hpp" #include<math.h> #include <string> int _tmain(int argc, _TCHAR* argv[]) { uchar c[100][100]; for(int i=0; i<100; i++) for(int j=0; j<100; j++) c[i][j] = (i<j)?0:255; imshow("x", Mat(100, 100, CV_8UC1, (void *)c)); waitKey(); return 0; }
是缺少了
using namespace cv;
using namespace std;
原文地址:https://www.cnblogs.com/wxl845235800/p/9107089.html
时间: 2024-10-08 21:48:43