{"id":23706989,"url":"https://github.com/josafatburmeister/circle_detection","last_synced_at":"2026-04-09T19:36:23.184Z","repository":{"id":262323997,"uuid":"874760767","full_name":"josafatburmeister/circle_detection","owner":"josafatburmeister","description":"A Python package for circle fitting.","archived":false,"fork":false,"pushed_at":"2024-12-28T16:40:33.000Z","size":214,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-28T17:28:13.210Z","etag":null,"topics":["circle","numpy","objectdetection","pointcloud","python"],"latest_commit_sha":null,"homepage":"","language":"Python","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/josafatburmeister.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2024-10-18T12:16:05.000Z","updated_at":"2024-12-28T16:40:36.000Z","dependencies_parsed_at":null,"dependency_job_id":"ab3228fa-edf5-4e84-ba71-2eee11342f13","html_url":"https://github.com/josafatburmeister/circle_detection","commit_stats":null,"previous_names":["josafatburmeister/circlefitting"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/josafatburmeister%2Fcircle_detection","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/josafatburmeister%2Fcircle_detection/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/josafatburmeister%2Fcircle_detection/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/josafatburmeister%2Fcircle_detection/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/josafatburmeister","download_url":"https://codeload.github.com/josafatburmeister/circle_detection/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":231882156,"owners_count":18440325,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["circle","numpy","objectdetection","pointcloud","python"],"created_at":"2024-12-30T16:01:52.958Z","updated_at":"2026-04-09T19:36:18.140Z","avatar_url":"https://github.com/josafatburmeister.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# circle_detection\n\n### A Python Package for Detecting Circles in 2D Point Sets.\n\n![pypi-image](https://badge.fury.io/py/circle-detection.svg)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![CI](https://github.com/josafatburmeister/circle_detection/actions/workflows/code-quality-main.yml/badge.svg)](https://github.com/josafatburmeister/circle_detection/actions/workflows/code-quality-main.yml)\n[![coverage](https://codecov.io/gh/josafatburmeister/circle_detection/branch/main/graph/badge.svg)](https://codecov.io/github/josafatburmeister/circle_detection?branch=main)\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/circle_detection)\n\nThe package allows to detect circles in a set of 2D points. Currently, the package implements the following circle\ndetection methods:\n\n- The M-estimator method proposed in [Garlipp, Tim, and Christine H. Müller. \"Detection of Linear and Circular Shapes in Image Analysis.\" Computational Statistics \u0026 Data Analysis 51.3 (2006): 1479-1490.](\u003chttps://doi.org/10.1016/j.csda.2006.04.022\u003e)\n- The [RANSAC](https://en.wikipedia.org/wiki/Random_sample_consensus) method based on least-squares circle fitting.\n\n### Get started\n\nThe package can be installed via pip:\n\n```bash\npython -m pip install circle-detection\n```\n\nThe package provides ```MEstimator``` and ```Ransac``` classes, which can be used as follows:\n\n```python\nfrom circle_detection import MEstimator, Ransac\nimport numpy as np\n\nxy = np.array([[-1, 0], [1, 0], [0, -1], [0, 1]], dtype=np.float64)\n\nm_estimator = MEstimator(bandwidth=0.05)\nm_estimator.detect(xy)\nm_estimator.filter(max_circles=1)\n\nprint(\"Circles detected by M-Estimator method:\", np.round(m_estimator.circles, 2))\nprint(\"Fitting scores:\", m_estimator.fitting_scores)\n\nransac = Ransac(bandwidth=0.05)\nransac.detect(xy)\nransac.filter(max_circles=1)\n\nprint(\"Circles detected by RANSAC method:\", np.round(ransac.circles, 2))\nprint(\"Fitting scores:\", ransac.fitting_scores)\n\n# Retrieve parameters of the detected circles\nif len(ransac.circles) \u003e 0:\n    circle_center_x, circle_center_y, circle_radius = ransac.circles[0]\n```\n\nThe package also supports batch processing, i.e. the parallel detection of circles in separate sets of points. For batch\nprocessing, the points of all input point sets must be stored in a flat array. Points that belong to the same point set\nmust be stored consecutively. The number of points per point set must then be specified using the `batch_lengths`\nparameter:\n\n```python\nfrom circle_detection import Ransac\nimport numpy as np\n\nxy = np.array(\n    [\n        [-1, 0],\n        [1, 0],\n        [0, -1],\n        [0, 1],\n        [0, 1],\n        [2, 1],\n        [1, 0],\n        [1, 2],\n        [1 + np.sqrt(2), 1 + np.sqrt(2)],\n    ],\n    dtype=np.float64,\n)\nbatch_lengths = np.array([4, 5], dtype=np.int64)\n\ncircle_detector = Ransac(bandwidth=0.05)\ncircle_detector.detect(xy, batch_lengths=batch_lengths)\ncircle_detector.filter(max_circles=1)\n\nprint(\"Circles:\", np.round(circle_detector.circles, 2))\nprint(\"Fitting scores:\", circle_detector.fitting_scores)\nprint(\"Number of circles detected in each point set:\", circle_detector.batch_lengths_circles)\n```\n\n### Package Documentation\n\nThe package documentation is available [here](https://josafatburmeister.github.io/circle_detection/stable).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjosafatburmeister%2Fcircle_detection","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjosafatburmeister%2Fcircle_detection","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjosafatburmeister%2Fcircle_detection/lists"}