目录
配置vscode
main.cpp
#include <iostream>
#include <opencv2/opencv.hpp>
using namespace cv;
using namespace std;
int main(){
cout <<"OpenCV"<<endl;
Mat img = imread("/home/0001#_0.jpg");
cout <<img.cols<<", "<<img.rows<<", "<<img.channels() << endl;
}
编译
运行
加入自己的模块
tasks.json修改
main.cpp
#include <iostream>
#include <opencv2/opencv.hpp>
#include "diy_lib/pyfunc.h"
#include <vector>
using namespace cv;
using namespace std;
int main(){
prints("OpenCV");
Mat img = imread("/home/0001#_0.jpg");
vector<int> shape = {img.cols,img.rows,img.channels()};
printvi(shape);
}
OpenCV
[64, 128, 3]