{"id":39659784,"url":"https://github.com/memory-overflow/standard-ellipse-detection","last_synced_at":"2026-01-18T09:22:57.472Z","repository":{"id":39886500,"uuid":"291305653","full_name":"memory-overflow/standard-ellipse-detection","owner":"memory-overflow","description":"A high-quality ellipse detector based on arc-support line segment for c++ project","archived":false,"fork":false,"pushed_at":"2024-06-13T06:48:48.000Z","size":1430,"stargazers_count":76,"open_issues_count":0,"forks_count":20,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-06-13T09:56:26.621Z","etag":null,"topics":["ellipse","ellipse-detection","ellipse-detector"],"latest_commit_sha":null,"homepage":"http://43.154.37.202","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/memory-overflow.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-08-29T16:18:13.000Z","updated_at":"2024-06-13T06:48:51.000Z","dependencies_parsed_at":"2024-06-13T09:34:31.459Z","dependency_job_id":"5e66ca97-f4ca-4b07-993f-022ce9c41e69","html_url":"https://github.com/memory-overflow/standard-ellipse-detection","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/memory-overflow/standard-ellipse-detection","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/memory-overflow%2Fstandard-ellipse-detection","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/memory-overflow%2Fstandard-ellipse-detection/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/memory-overflow%2Fstandard-ellipse-detection/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/memory-overflow%2Fstandard-ellipse-detection/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/memory-overflow","download_url":"https://codeload.github.com/memory-overflow/standard-ellipse-detection/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/memory-overflow%2Fstandard-ellipse-detection/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28534159,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-18T00:39:45.795Z","status":"online","status_checked_at":"2026-01-18T02:00:07.578Z","response_time":98,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ellipse","ellipse-detection","ellipse-detector"],"created_at":"2026-01-18T09:22:56.942Z","updated_at":"2026-01-18T09:22:57.466Z","avatar_url":"https://github.com/memory-overflow.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 介绍\n本库提供了一个可以在工业中稳定使用的椭圆检测方法。对于图像中的标准、明显、完整、大小在 100x100 像素以上的椭圆的检测效果非常好，速度也很快。\n这个库的实现参考了论文 https://arxiv.org/pdf/1810.03243v4.pdf。\n\n微信小程序搜索\"椭圆识别\"可以体验效果（小程序首次使用需要启动服务，第一张图片可能会失败，多试几次）。\n\n![image](https://user-images.githubusercontent.com/15645203/226512866-71bbaab5-6e43-41ef-bac7-23b61733269d.png)\n\n也可以线上体验：http://43.154.37.202\n\n\n\n\n# 效果展示\n\n\n![图1](https://github.com/memory-overflow/standard-ellipse-detection/blob/master/images/test12_result.jpg)\n\n![图2](https://github.com/memory-overflow/standard-ellipse-detection/blob/master/images/test6_result.jpg)\n\n![图3](https://github.com/memory-overflow/standard-ellipse-detection/blob/master/images/test9_result.jpg)\n\n\n\n# 安装\n## Ubuntu\n### Install opencv\nopencv 需要通过源码安装，ubuntu opencv 的安装可以参考博客 https://blog.csdn.net/Arthur_Holmes/article/details/100146463, 注意本项目中一定要安装 opencv3 的版本，否则可能会有兼容性问题。服务器版本无需安装图像化相关的库。\n\n### Install lapack\nlapack 是一个矩阵运算的库，也是需要源码安装。\n先下载[lapack源码](https://github.com/Reference-LAPACK/lapack/archive/refs/tags/v3.9.1.tar.gz)，lapack 是 gfortran 写的，要先`sudo apt-get install gfortran`安装gfortran 才能正常编译。\n\n执行下面的操作完成安装\n```\ntar -xzvf lapack-3.9.1.tar.gz \u0026\u0026 cd lapack-3.9.1\nmkdir build \u0026\u0026 cd build\ncmake ..\nmake -j7\nsudo make install\nsudo ldconfig\ncd ..\nsudo cp LAPACKE/include/*.h /usr/local/include/\n```\n\n### Install ellipse-detection\n执行下面的操作完成安装\n```\ngit clone https://github.com/memory-overflow/standard-ellipse-detection.git\ncd standard-ellipse-detection\nmkdir build \u0026\u0026 cd build\ncmake ..\nmake\nsudo make install\n```\n\n## Centos\n### Install opencv\nopencv 需要通过源码安装，centos 的 opencv 的安装可以参考博客 https://www.jianshu.com/p/1cb1ca235eb3, 注意本项目中一定要安装 opencv3 的版本，否则可能会有兼容性问题。服务器版本无需安装图像化相关的库。\n\n\n### Install lapack\nlapack 是一个矩阵运算的库，也是需要源码安装。\n先下载[lapack源码](https://github.com/Reference-LAPACK/lapack/archive/refs/tags/v3.9.1.tar.gz)，lapack 是 gfortran 写的，要先`yum install gcc-gfortran`安装 gfortran 才能正常编译。\n\n由于 lapack 的编译需要 cmake3, 先安装 cmake3, `yum install cmake3`\n\n执行下面的操作完成 lapack 的安装\n```\ntar -xzvf lapack-3.9.1.tar.gz \u0026\u0026 cd lapack-3.9.1\nmkdir build \u0026\u0026 cd build\ncmake3 ..\nmake -j7\nsudo make install\nsudo ldconfig\ncd ..\nsudo cp LAPACKE/include/*.h /usr/local/include/\n```\n\n### Install ellipse-detection\n执行下面的操作完成安装\n```\ngit clone https://github.com/memory-overflow/standard-ellipse-detection.git\ncd standard-ellipse-detection\nmkdir build \u0026\u0026 cd build\ncmake3 ..\nmake\nsudo make install\n```\n提供一个 centos server 的镜像，可以作为基础镜像开发，里面装好的依赖和库。\n```\ndocker pull jisuanke/standard-ellipse-detection-centos7\n```\n\n\n## Other system\n不建议在 mac 和 windows 上使用此库。mac 的兼容性比较差，我尝试在 mac 上编译，最后因为 gfortran 链接库不兼容放弃。\nwindows 上的编译和使用的IDE有关，如需要使用，按照 opencv，lapack, ellipsedetect 的顺序依次编译。\n\n其他类unix的操作系统比如安卓可以自行参考 ubuntu 和 centos 的流程编译安装。\n\n# 接口和使用方法\n代码中引用头文件`#include \"ellipse_detection/detect.h\"`，然后引入namespace zgh。\n\n接口说明\n```\nbool detectEllipse(const uint8_t *image, int height, int width,\n                   std::vector\u003cstd::shared_ptr\u003cEllipse\u003e \u003e \u0026ells,\n                   int polarity = 0, double line_width = 2.0);\n```\n- 输入参数:\n    - image 图像原始数据，灰度图，彩色图需要先转换成灰度图，并且转换成一维数组输入\n    - height 图像高度\n    - width 图像宽度\n    - polarity 表示椭圆极性，-1、0、1, 默认为 0，检测所有极性。\n    - line_width 椭圆线宽，单位像素，推荐使用默认值\n- 输出\n    - ells 检测到的椭圆列表\n\n关于 Ellipse 结构的说明\n```\nPointd o; // 椭圆中心点坐标\ndouble a, b; // 短半轴长度，长半轴长度\ndouble phi; // 椭圆偏角，单位为弧度\nint polarity; // 椭圆极性\ndouble goodness; // 椭圆评分\ndouble coverangle; // 椭圆角度完整程度\nstd::vector\u003cPixel\u003e inliers; // 构成的像素点\n```\n输出的图像坐标系\n![image](https://github.com/memory-overflow/standard-ellipse-detection/assets/15645203/a6f388df-3a51-4dac-8d27-a106d496362a)\n\n\n\n# 测试\n提供了1个测试工具，可以查看算法效果。需要桌面版的操作系统才能显示图片，如果是服务器版本的操作系统，需要注释掉 imshow 部分。\n```\ncmake3 .. -DBUILD_TESTING=ON\nmake\n./bin/testdetect [image_dir1] [image_dir2] [image_dir3] ...\n```\n\n\n\n\n有问题欢迎联系 zhengaohong@gmail.com, wechat: islands___\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmemory-overflow%2Fstandard-ellipse-detection","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmemory-overflow%2Fstandard-ellipse-detection","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmemory-overflow%2Fstandard-ellipse-detection/lists"}