Python based detector detecting position and orientation of circular pads. This detection is based on the positions of the partial shapes (inner halls) and ArUco marker(s).
Project description
Circle & ArUco Marker Detector
28.7.2025: Julia Škovierová, Pavel Krsek
The detector was developed within the framework of the DeKrys project to estimate the position of the destination plate. The plate is a circle made of metal (copper or aluminium). There are three small holes in the plate. The small holes are evenly spaced on a circle. The plate is usually provided by an ArUco marker. The ArUco marker is placed outside the main circle of the plate on the attached small square plate. The ArUco marker identifies the plate and defines a unique coordinate system.
This Python module provides a simple class-based interface to detect circles and ArUco markers in an image using OpenCV. It returns information such as the center, perimeter, and marker ID (if available).
Requirements
- Python 3.7+
- NumPy standard library
- OpenCV with ArUco support
- Instalation:
pip install -r requirements.txt
Instalation
Project can be isntalled directly trough pip
pip install CircleDetector
Usage in code
import CircleDetector
# 2. Load Image (as file path or NumPy array)
image = cv2.imread("path/to/image.png")
# 3. Create Detector Instance
circle_detector = CircleDetector()
# 4. Run Detection
large_circle_data = circle_detector.detect(image, True)
Output Format - example
List of "large circles" is output of the detector. Position of each "large circle" is described by many parametrs in the dictionary.
Parameters of large circle (for each):
center- vector defines the position of the large circle center in the image coordinate system [columns, rows].radius- radius of the large circle in pixels.small_circles- matrix of the small circle parameters. 3 small circles should be inside the large circle. Each row of the matrix corresponds to one small circle and contains the position of the center and radius in pixels in order: [columns, rows, radius].marker_center- vector defines position of the ArUco marker center in the image coordinate system [columns, rows].marker_id- the numeric ID of the ArUco marker.marker_corners- positions of the ArUco marker corners written in the matrix, where each row corresponds to one corner.marker_angle- angle in radians between row and vector defined by points: circle_center, marker_center. The coordinates are in the image coordinate system in order (in each line): [columns, rows].
Note: All the positon parameters are in pixels.
Example of the output
[{'center': array([1924, 1402]),
'radius': 389,
'small_circles': array([[2223., 1377., 39.],
[1751., 1153., 39.],
[1794., 1672., 39.]], dtype=float32),
'marker_center': array([2391. , 1364.25], dtype=float32),
'marker_id': 7,
'marker_corners': array([[2325., 1303.],
[2452., 1296.],
[2457., 1427.],
[2330., 1431.]], dtype=float32),
'marker_angle': 0.08065973744726256}]
Notes
In case that the refinement option is selected, but not enough points are found to recalculate the circle, the value for the center and radius remains unchanged
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file circledetector-1.0.0.tar.gz.
File metadata
- Download URL: circledetector-1.0.0.tar.gz
- Upload date:
- Size: 10.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fb6fe5735033532a56e543a544cbb5d80ac9964b85e9c357bdc0473b51790907
|
|
| MD5 |
de1492d70ca68d8a6b010b7c3c0b7870
|
|
| BLAKE2b-256 |
5a58c94cd9701dcca26d03c69adc267ca74acf8978c69947b32c189eadba3ba9
|
File details
Details for the file circledetector-1.0.0-py3-none-any.whl.
File metadata
- Download URL: circledetector-1.0.0-py3-none-any.whl
- Upload date:
- Size: 9.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6208beeb812fc2b9210b710c758ee9657f53a84ff883ed0a2c6846bfcc447e0b
|
|
| MD5 |
de240ecf015fdd409247584318a2fa68
|
|
| BLAKE2b-256 |
0e882b69f23a0f9d243704834c2ce8df17ec1faa1ad33a2ffcd96fa84863c5a9
|