opencv 3.0 填充矩形 填充多边形 fillPoly
2017-10-12 14:33
513 查看
http://blog.csdn.net/billbliss/article/details/43968291
opencv中没有旋转矩形,也没有填充矩形
原来它封装了一个 填充多边形fillPoly()
不多说上代码
[cpp] view
plain copy
void drawpoly()
{
Mat img(500, 500, CV_8U, Scalar(0));
Point root_points[1][4];
root_points[0][0] = Point(215,220);
root_points[0][1] = Point(460,225);
root_points[0][2] = Point(466,450);
root_points[0][3] = Point(235,465);
const Point* ppt[1] = {root_points[0]};
int npt[] = {4};
polylines(img, ppt, npt, 1, 1, Scalar(255),1,8,0);
imshow("Test", img);
waitKey();
fillPoly(img, ppt, npt, 1, Scalar(255));
imshow("Test", img);
waitKey();
}
结果如图
opencv中没有旋转矩形,也没有填充矩形
原来它封装了一个 填充多边形fillPoly()
不多说上代码
[cpp] view
plain copy
void drawpoly()
{
Mat img(500, 500, CV_8U, Scalar(0));
Point root_points[1][4];
root_points[0][0] = Point(215,220);
root_points[0][1] = Point(460,225);
root_points[0][2] = Point(466,450);
root_points[0][3] = Point(235,465);
const Point* ppt[1] = {root_points[0]};
int npt[] = {4};
polylines(img, ppt, npt, 1, 1, Scalar(255),1,8,0);
imshow("Test", img);
waitKey();
fillPoly(img, ppt, npt, 1, Scalar(255));
imshow("Test", img);
waitKey();
}
结果如图
相关文章推荐
- opencv 3.0 填充矩形 填充多边形 fillPoly
- OpenCV在图像上画线、矩形、椭圆、多边形、填充的多边形、圆、显示文字
- 【opencv】填充多边形 fillPoly
- opencv-线,椭圆,长方形(矩形),圆,填充多边形绘制
- opencv 填充矩形 填充多边形
- openCV 画矩形框或填充矩形
- OpenCV2.4.13 中 选取roi区域,任意形状(矩形,不规则多边形,圆形,椭圆,手动指定形状)
- OpenGL研究3.0 多边形区域填充
- OpenCV环境下绘制轮廓的外接多边形、最小立式矩形、最小外接圆
- OpenCV学习九:绘制直线、矩形、椭圆、原型、填充任意图形
- opencv学习笔记(十)画直线、矩形、圆形、椭圆以及多边形程序
- Opencv用鼠标绘制填充多边形
- opencv在图片指定区域内填充矩形,并在图片中显示矩形的轮廓
- OpenCV之imgproc 模块. 图像处理(5)在图像中寻找轮廓 计算物体的凸包 创建包围轮廓的矩形和圆形边界框 为轮廓创建可倾斜的边界框和椭圆 轮廓矩 多边形测试
- openCV 画矩形框或填充矩形
- 【OpenCV3】几何图形(直线、矩形、圆、椭圆、多边形等)绘制
- OpenGL研究3.0 多边形区域填充
- OpenCv学习笔记(六):使用opencv画线、矩形、椭圆、多边形线、多边形体等
- python opencv绘制多边形和多边形填充
- opencv3.0识别并提取图形中的矩形