opencv中绘制椭圆的函数ellipse

#include 
#include 
using namespace std;
using namespace cv;
#define WINDOW_NAME1 "【绘制图1】"
#define WINDOW_WIDTH 600 //定制窗口大小
//画椭圆函数

int main(int argc, char** argv)
{
	//创建空白图像
	Mat src = Mat::zeros(WINDOW_WIDTH, WINDOW_WIDTH, CV_8UC3);
	//绘制椭圆
	int thickness = 2;//线宽
	int lineType = 8;
	int angle = 90;//椭圆的偏转角度
	ellipse(src, Point(WINDOW_WIDTH/2, WINDOW_WIDTH/2), Size(WINDOW_WIDTH / 4, WINDOW_WIDTH / 16),
		angle, 0, 360, Scalar(255, 255, 0), thickness, lineType);
	namedWindow(WINDOW_NAME1, CV_WINDOW_AUTOSIZE);
	imshow(WINDOW_NAME1, src);
	waitKey(0);
	return 0;
}

你可能感兴趣的:(opencv,计算机视觉,人工智能)