Standard Ellipse Detection 使用教程

Standard Ellipse Detection 使用教程

standard-ellipse-detection A high-quality ellipse detector based on arc-support line segment for c++ project standard-ellipse-detection 项目地址: https://gitcode.com/gh_mirrors/st/standard-ellipse-detection

1、项目介绍

Standard Ellipse Detection 是一个基于弧线支持的线段进行椭圆检测的开源项目。它适用于工业领域,可以稳定地检测图像中标准、明显、完整且大小在 100x100 像素以上的椭圆。该库的检测效果非常好,且速度较快,基于 C++ 实现。

2、项目快速启动

安装依赖

  1. OpenCV 3:

    • Ubuntu: 参考博客 https://blog.csdn.net/Arthur_Holmes/article/details/100146463 进行安装。
    • CentOS: 参考博客 https://www.jianshu.com/p/1cb1ca235eb3 进行安装。
  2. LAPACK:

    • 下载 LAPACK 源码,使用 gfortran 编译安装。
  3. Standard Ellipse Detection:

    • 使用 git 克隆代码仓库: git clone https://github.com/memory-overflow/standard-ellipse-detection
    • 进入项目目录,执行以下命令编译安装:
      mkdir build && cd build
      cmake ..
      make
      sudo make install
      

使用方法

  1. 引入头文件:

    #include "ellipse_detection/detect.h"
    
  2. 引入命名空间:

    using namespace zgh;
    
  3. 使用 detectEllipse 函数进行检测:

    bool detectEllipse(
        const uint8_t *image,  // 图像原始数据,灰度图
        int height,            // 图像高度
        int width,             // 图像宽度
        std::vector<std::shared_ptr<Ellipse> > &ells, // 检测到的椭圆列表
        int polarity = 0,       // 椭圆极性 (-1, 0, 1)
        double line_width = 2.0  // 椭圆线宽
    );
    
  4. Ellipse 结构说明:

    struct Ellipse {
        Pointd o;           // 椭圆中心点坐标
        double a, b;        // 短半轴长度, 长半轴长度
        double phi;         // 椭圆偏角, 单位为弧度
        int polarity;        // 椭圆极性
        double goodness;     // 椭圆评分
        double coverangle;   // 椭圆角度完整程度
        std::vector<Pixel> inliers; // 构成的像素点
    };
    

3、应用案例和最佳实践

应用案例

  1. 工业检测: 用于检测产品上的标准椭圆标记。
  2. 图像处理: 用于分割图像中的椭圆区域。

最佳实践

  1. 确保图像质量,避免噪声干扰。
  2. 调整参数,如极性和线宽,以适应不同场景。
  3. 对检测结果进行后续处理,如滤波和跟踪。

4、典型生态项目

standard-ellipse-detection A high-quality ellipse detector based on arc-support line segment for c++ project standard-ellipse-detection 项目地址: https://gitcode.com/gh_mirrors/st/standard-ellipse-detection

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

姚蔚桑Dominique

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值