Python bindings for the fast ChESS chessboard corner detector (Rust backend)
Project description
chess_corners (Python)
Python bindings for the chess-corners detector.
Quick start
import numpy as np
import chess_corners
img = np.zeros((128, 128), dtype=np.uint8)
cfg = chess_corners.ChessConfig()
cfg.threshold_rel = 0.2
cfg.min_cluster_size = 1
corners = chess_corners.find_chess_corners(img, cfg)
print(corners.shape, corners.dtype)
You can also configure the detector via nested config objects:
cfg = chess_corners.ChessConfig()
cfg.params.threshold_rel = 0.2
cfg.multiscale.pyramid.num_levels = 2
What find_chess_corners returns
find_chess_corners(image, cfg=None) returns a NumPy float32 array of shape
(N, 4) with columns:
x– subpixel x coordinate (pixels, image space)y– subpixel y coordinate (pixels, image space)response– ChESS response strength at the cornerorientation– local grid axis orientation in radians, in[0, pi)
The rows are sorted deterministically by the binding:
response (descending), then x, then y.
Input requirements:
imagemust be a 2Duint8NumPy array with shape(H, W)- it must be C-contiguous (non-contiguous arrays raise
ValueError)
ChessConfig parameters
ChessConfig mirrors the most important Rust settings. Defaults match the
Rust ChessConfig::default().
Response / detector parameters (cfg.*):
use_radius10(bool, defaultFalse)- Use the larger ring radius (r=10) instead of r=5 for response computation.
descriptor_use_radius10(Optional[bool], defaultNone)- Override the descriptor sampling ring radius; when
None, usesuse_radius10.
- Override the descriptor sampling ring radius; when
threshold_rel(float, default0.2)- Relative threshold as a fraction of the max response.
threshold_abs(Optional[float], defaultNone)- Absolute threshold; when set, it overrides
threshold_rel.
- Absolute threshold; when set, it overrides
nms_radius(int, default2)- Non-maximum suppression radius in pixels.
min_cluster_size(int, default2)- Minimum count of positive neighbors in the NMS window to accept a corner.
Multiscale parameters (cfg.*):
pyramid_num_levels(int, default3)- Number of pyramid levels (including base). Set to
1for single-scale.
- Number of pyramid levels (including base). Set to
pyramid_min_size(int, default128)- Minimum dimension to keep building the pyramid.
refinement_radius(int, default3)- Coarse-level ROI radius used for coarse-to-fine refinement.
merge_radius(float, default3.0)- Merge near-duplicate refined corners within this radius (pixels).
Full configuration structs
The Python bindings expose all configuration structs directly. You can use the nested API for clarity:
ChessConfig.params→ChessParamsChessConfig.multiscale→CoarseToFineParamsCoarseToFineParams.pyramid→PyramidParams
All fields listed above are available in the nested structs as well.
Classical refiners
Select the classic refiner via ChessParams.refiner:
cfg = chess_corners.ChessConfig()
cfg.params.refiner = chess_corners.RefinerKind.forstner(
chess_corners.ForstnerConfig()
)
Available configs:
CenterOfMassConfigForstnerConfigSaddlePointConfig
ML refiner
If the bindings are built with the ml-refiner feature, an ML-backed refiner
is available via find_chess_corners_with_ml:
cfg = chess_corners.ChessConfig()
corners = chess_corners.find_chess_corners_with_ml(img, cfg)
The ML refiner uses built-in defaults and ignores the model’s confidence output in the current version.
Development
maturin develop -m crates/chess-corners-py/pyproject.toml
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 Distributions
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 chess_corners-0.4.1.tar.gz.
File metadata
- Download URL: chess_corners-0.4.1.tar.gz
- Upload date:
- Size: 794.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
63796c5289c62ad304815ccc2c723345233f79353a37eb81945deec64e8b125e
|
|
| MD5 |
e10bc00486eb0a6b7fcbe6f9bf1c2250
|
|
| BLAKE2b-256 |
482f56c6d79c3a575dc8e7cbc7ce3154c71d58a5be978e64c3bdd8474a35c762
|
Provenance
The following attestation bundles were made for chess_corners-0.4.1.tar.gz:
Publisher:
release-pypi.yml on VitalyVorobyev/chess-corners-rs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
chess_corners-0.4.1.tar.gz -
Subject digest:
63796c5289c62ad304815ccc2c723345233f79353a37eb81945deec64e8b125e - Sigstore transparency entry: 1189174208
- Sigstore integration time:
-
Permalink:
VitalyVorobyev/chess-corners-rs@a2af8a969f80ce32b54990d429a13bba09557f57 -
Branch / Tag:
refs/tags/v0.4.1 - Owner: https://github.com/VitalyVorobyev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-pypi.yml@a2af8a969f80ce32b54990d429a13bba09557f57 -
Trigger Event:
push
-
Statement type:
File details
Details for the file chess_corners-0.4.1-cp310-abi3-win_amd64.whl.
File metadata
- Download URL: chess_corners-0.4.1-cp310-abi3-win_amd64.whl
- Upload date:
- Size: 5.9 MB
- Tags: CPython 3.10+, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cebcfcf59fc5467a42d1e9c26b71b9f7cb078cb54f94fafbb9d31640e89346cd
|
|
| MD5 |
c23771fc13fd0c94129985ad2dae9a9d
|
|
| BLAKE2b-256 |
8ac0f388f5759bde6a731ff75a65227b603aff7174c05154e97af5cef780bb9e
|
Provenance
The following attestation bundles were made for chess_corners-0.4.1-cp310-abi3-win_amd64.whl:
Publisher:
release-pypi.yml on VitalyVorobyev/chess-corners-rs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
chess_corners-0.4.1-cp310-abi3-win_amd64.whl -
Subject digest:
cebcfcf59fc5467a42d1e9c26b71b9f7cb078cb54f94fafbb9d31640e89346cd - Sigstore transparency entry: 1189174235
- Sigstore integration time:
-
Permalink:
VitalyVorobyev/chess-corners-rs@a2af8a969f80ce32b54990d429a13bba09557f57 -
Branch / Tag:
refs/tags/v0.4.1 - Owner: https://github.com/VitalyVorobyev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-pypi.yml@a2af8a969f80ce32b54990d429a13bba09557f57 -
Trigger Event:
push
-
Statement type:
File details
Details for the file chess_corners-0.4.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: chess_corners-0.4.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 6.8 MB
- Tags: CPython 3.10+, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d218e7012ecc3a74016bb5d9b6072f5a68465ee1daa772509b212c16bae0952c
|
|
| MD5 |
d5acb69d1a2d47f8d0368a16848a7d0d
|
|
| BLAKE2b-256 |
d5406e97b75c6a5427043ecb30a155f0adb50ca1cffea560ce3302c691e32cee
|
Provenance
The following attestation bundles were made for chess_corners-0.4.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:
Publisher:
release-pypi.yml on VitalyVorobyev/chess-corners-rs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
chess_corners-0.4.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl -
Subject digest:
d218e7012ecc3a74016bb5d9b6072f5a68465ee1daa772509b212c16bae0952c - Sigstore transparency entry: 1189174246
- Sigstore integration time:
-
Permalink:
VitalyVorobyev/chess-corners-rs@a2af8a969f80ce32b54990d429a13bba09557f57 -
Branch / Tag:
refs/tags/v0.4.1 - Owner: https://github.com/VitalyVorobyev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-pypi.yml@a2af8a969f80ce32b54990d429a13bba09557f57 -
Trigger Event:
push
-
Statement type:
File details
Details for the file chess_corners-0.4.1-cp310-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: chess_corners-0.4.1-cp310-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 5.7 MB
- Tags: CPython 3.10+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ba2d8b49ebf0109f89853563c2a29b50e9726f80206cfb9158ffbf0951197608
|
|
| MD5 |
234bb1d5b1e0317fb628a558e33c8ec7
|
|
| BLAKE2b-256 |
d49578bdba5d79cfb7703a54abdc9d8b1afb9fe2e072c3c6f093ae0f70e196e8
|
Provenance
The following attestation bundles were made for chess_corners-0.4.1-cp310-abi3-macosx_11_0_arm64.whl:
Publisher:
release-pypi.yml on VitalyVorobyev/chess-corners-rs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
chess_corners-0.4.1-cp310-abi3-macosx_11_0_arm64.whl -
Subject digest:
ba2d8b49ebf0109f89853563c2a29b50e9726f80206cfb9158ffbf0951197608 - Sigstore transparency entry: 1189174225
- Sigstore integration time:
-
Permalink:
VitalyVorobyev/chess-corners-rs@a2af8a969f80ce32b54990d429a13bba09557f57 -
Branch / Tag:
refs/tags/v0.4.1 - Owner: https://github.com/VitalyVorobyev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-pypi.yml@a2af8a969f80ce32b54990d429a13bba09557f57 -
Trigger Event:
push
-
Statement type: