Metadata-Version: 2.1
Name: circle_detection
Version: 0.2.0
Summary: A Python package for detecting circles in 2D point sets.
Keywords: circle fitting,data science
Author-Email: Josafat-Mattias Burmeister <burmeister@uni-potsdam.de>
Maintainer-Email: Josafat-Mattias Burmeister <burmeister@uni-potsdam.de>
License: MIT License
        
        Copyright (c) 2024 Josafat-Mattias Burmeister
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
Classifier: Development Status :: 4 - Beta
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Project-URL: Homepage, https://github.com/josafatburmeister/circle_detection
Project-URL: Documentation, https://josafatburmeister.github.io/circle_detection/
Project-URL: Repository, https://github.com/josafatburmeister/circle_detection.git
Project-URL: Issues, https://github.com/josafatburmeister/circle_detection/issues
Project-URL: Changelog, https://josafatburmeister.github.io/circle_detection/changelog
Requires-Python: >=3.9
Requires-Dist: numpy<3.0.0,>=1.21.0
Requires-Dist: clang-format; extra == "dev"
Requires-Dist: clang-tidy; extra == "dev"
Requires-Dist: black; extra == "dev"
Requires-Dist: mypy; extra == "dev"
Requires-Dist: pre-commit; extra == "dev"
Requires-Dist: pylint; extra == "dev"
Requires-Dist: pytest; extra == "dev"
Requires-Dist: pytest-cov; extra == "dev"
Requires-Dist: sphinx; extra == "docs"
Requires-Dist: sphinx-copybutton; extra == "docs"
Requires-Dist: sphinx-design; extra == "docs"
Requires-Dist: sphinx-docsearch; extra == "docs"
Requires-Dist: sphinxawesome-theme; extra == "docs"
Requires-Dist: sphinx-sitemap; extra == "docs"
Requires-Dist: sphinxcontrib-jsmath; extra == "docs"
Requires-Dist: sphinxcontrib-katex; extra == "docs"
Requires-Dist: sphinxcontrib-napoleon; extra == "docs"
Requires-Dist: sphinx_mdinclude; extra == "docs"
Provides-Extra: dev
Provides-Extra: docs
Description-Content-Type: text/markdown

# circle_detection

### A Python Package for Detecting Circles in 2D Point Sets.

![pypi-image](https://badge.fury.io/py/circle-detection.svg)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![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)
[![coverage](https://codecov.io/gh/josafatburmeister/circle_detection/branch/main/graph/badge.svg)](https://codecov.io/github/josafatburmeister/circle_detection?branch=main)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/circle_detection)

The package allows to detect circles in a set of 2D points using the M-estimator method proposed in [Garlipp, Tim, and Christine H. Müller. "Detection of Linear and Circular Shapes in Image Analysis." Computational Statistics & Data Analysis 51.3 (2006): 1479-1490.](<https://doi.org/10.1016/j.csda.2006.04.022>)

### Get started

The package can be installed via pip:

```bash
python -m pip install circle-detection
```

The package provides a method ```detect_circles```, which can be used as follows:

```python
from circle_detection import detect_circles
import numpy as np

xy = np.array([[-1, 0], [1, 0], [0, -1], [0, 1]], dtype=np.float64)

detected_circles, fitting_losses = detect_circles(xy, bandwidth=0.05, max_circles=1)

if len(detected_circles) > 0:
    circle_center_x, circle_center_y, circle_radius = detected_circles[0]
```

### Package Documentation

The package documentation is available [here](https://josafatburmeister.github.io/circle_detection/stable).
