ERROR:imshow、Mat、waitkey找不到标识符(opencv)

可以发现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;

 

 

posted @ 2018-05-29 19:08  ostartech  阅读(1961)  评论(0编辑  收藏  举报