OpenCV的minEllipse函数(求轮廓的外接椭圆)一定要判断输入点是否大于5个
2016-07-05 15:13
375 查看
如题,如果不判断,是要报错的,如下图所示:
OpenCV Error: Incorrect size of input array (There should be at least 5 points to fit the ellipse) in cv::fitEllipse, file C:\builds\master_PackSlave-win32-vc11-shared\opencv\modules\imgproc\src\shapedescr.cpp, line 379
正确使用的代码如下:
-------------------------------------------
本文由OpenCV代码网提供,OpenCV代码网的网址为http://opencv66.net/
本文由OpenCV代码网提供,OpenCV代码网的网址为http://opencv66.net/
本文由OpenCV代码网提供,OpenCV代码网的网址为http://opencv66.net/
OpenCV Error: Incorrect size of input array (There should be at least 5 points to fit the ellipse) in cv::fitEllipse, file C:\builds\master_PackSlave-win32-vc11-shared\opencv\modules\imgproc\src\shapedescr.cpp, line 379
正确使用的代码如下:
// 求轮廓的外接椭圆 if (contours[i].size() > 5) //使用前一定要判断是否大于5个点,小于5个点要报错 { minEllipse[i] = fitEllipse(Mat(contours[i])); }
-------------------------------------------
本文由OpenCV代码网提供,OpenCV代码网的网址为http://opencv66.net/
本文由OpenCV代码网提供,OpenCV代码网的网址为http://opencv66.net/
本文由OpenCV代码网提供,OpenCV代码网的网址为http://opencv66.net/
相关文章推荐
- NOPI使用手册
- Linux修改Shell命令提示符及颜色
- Linux下安装Hadoop(2.7.1)详解及WordCount运行
- nginx codeigniter 配置
- u-boot向linux内核传递启动参数
- 解决 RHEL 7/ CentOS 7/Fedora 出现Unit iptables.service failed to load
- Linux基础命令
- shell 导入csv到mysql
- Apache Maven 入门篇(下)
- hadoop 里常用命令
- hadoop 里常用命令
- Apache Maven 入门篇 ( 上 )
- linux下常用命令
- linux下常用命令
- openstack M版安装 镜像(image,glance)服务篇
- Linux性能测试 netstat命令
- centos下安装nginx
- 在ubuntu14.04下安装hbase1.1.3与hadoop2.6.4的相关配置
- svn使用openldap验证apache访问方式
- svn使用openldap验证apache访问方式