#include <cstdio>
#include <opencv2/opencv.hpp>
using namespace cv;
int main(){
//Mat img(400, 400, CV_8UC3, Scalar(255,255,255));
Mat img=imread("1.jpg");
Mat_<Vec3b> m2 = img;
Point points[1][4];
points[0][0] = Point(90, 180);
points[0][1] = Point(240, 130);
points[0][2] = Point(230, 240);
points[0][3] = Point(60, 240);
const Point* ppt[1] = {points[0]};
int npt[] = {4};
polylines(img, ppt, npt, 1, 1, Scalar(0,255,255),4);
imshow("window", img);
imshow("window2", m2);
waitKey(0);
return 0;
}
根据点画多边形
最新推荐文章于 2024-03-19 16:30:44 发布