opencv中没有旋转矩形,也没有填充矩形
原来它封装了一个 填充多边形fillPoly()
#include <opencv2/opencv.hpp>
#include <iostream>
#pragma comment(lib,"opencv_world341.lib")
using namespace cv;
using namespace std;
int main()
{
Mat im(512, 512, CV_8UC1, Scalar(0));
Point pts[1][4];
pts[0][0] = Point(215, 220);
pts[0][1] = Point(460, 225);
pts[0][2] = Point(466, 450);
pts[0][3] = Point(235, 465);
const Point* ppt[1] = { pts[0] };
int npt[] = { 4 };
polylines(im, ppt, npt, 1, 1, Scalar(255), 1, 8, 0);
imshow("Test", im);
waitKey();
fillPoly(im, ppt, npt, 1, Scalar(255));
imshow("Test", im);
waitKey();
return 0;
}
参考文章:
1. https://blog.youkuaiyun.com/billbliss/article/details/43968291