标签:desktop top wait key show pat enc opencv char*
#include "pch.h"
#include <iostream>
#include <highgui.hpp>
#include <highgui/highgui_c.h>
#include <opencv2/core/core.hpp>
#include <opencv2/imgproc/imgproc.hpp>
//#include <opencv2/core/core.hpp>
//#include <opencv2/highgui/highgui.hpp>
//#include <opencv2/opencv.hpp>
using namespace cv;
using namespace std;
//const char* path = "C:\\Users\\fengl\\Desktop\\素材.avi";
const char* path = "C:\\Users\\fengl\\Desktop\\p1.jpg";
int main()
{
cv::Mat tomato = cv::imread(path, 1);
Rect rec(tomato.cols / 4, tomato.rows / 4, tomato.cols / 2, tomato.cols / 2);
Mat img = tomato(rec);
cv::imshow("test", tomato);
cv::waitKey(1000);
cv::imshow("test", img);
cv::waitKey(1000);
return 0;
}
标签:desktop top wait key show pat enc opencv char*
原文地址:https://www.cnblogs.com/zfq572815535/p/10034461.html