c++版本
效果图:
#include <iostream>
#include <opencv/cv.hpp>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include<opencv2/imgproc/imgproc.hpp>
using namespace std;
using namespace cv;
//定义画椭圆的函数
void DrawEcllipse(Mat img,double angle)
{
int thickness=2;
int LineType=8;
ellipse(img,
Point(400,400),
Size(200,50),
angle,
0,
360,
Scalar(255,129,0),
thickness,
LineType
);
}
//主函数
int main(void)
{
//创建空白Mat图像
Mat atomImage=Mat::zeros(800,800,CV_8UC3);
DrawEcllipse(atomImage,90);
imshow("test",atomImage);
waitKey(0);
return(0);
}