Skip to main content

No project description provided

Project description

calib-targets Python bindings

This repo ships Python bindings for the high-level calib-targets facade crate.

Build & develop

pip install maturin
maturin develop
python -c "import calib_targets; print(calib_targets)"

API

The module name is calib_targets and it exposes three functions:

  • detect_chessboard(image, *, chess_cfg=None, params=None) -> dict | None
  • detect_charuco(image, *, chess_cfg=None, params) -> dict
  • detect_marker_board(image, *, chess_cfg=None, params=None) -> dict | None

Inputs and config:

  • image must be a 2D numpy.ndarray with dtype=uint8 (grayscale).
  • chess_cfg accepts None, a dict of overrides, or a ChessConfig instance.
  • params accepts None, a dict of overrides, or typed params classes.
  • detect_charuco requires params and the board lives in params.board (or params["board"] for dict overrides).

Notes:

  • Typed config classes exposed by the module include ChessConfig, ChessCornerParams, CoarseToFineParams, PyramidParams, ChessboardParams, OrientationClusteringParams, GridGraphParams, CharucoDetectorParams, ScanDecodeConfig, MarkerBoardParams, CircleScoreParams, CircleMatchParams, CharucoBoardSpec, MarkerBoardLayout, and MarkerCircleSpec.
  • Dict overrides can be partial; unknown keys raise ValueError listing valid keys.
  • target_position is populated only when the board layout includes a valid cell_size and alignment succeeds. For marker boards, set params.layout.cell_size or params["layout"]["cell_size"].
  • Typed config objects expose mutable attributes (set fields directly in Python).

Output schema (authoritative)

All outputs are JSON-compatible dicts/lists with basic Python types.

Common shapes:

  • Point2: [x, y] (floats).
  • GridCoords: {"i": int, "j": int}.
  • TargetDetection:
    • kind: "chessboard" | "charuco" | "checkerboard_marker".
    • corners: list of LabeledCorner.
  • LabeledCorner:
    • position: Point2.
    • grid: GridCoords | None.
    • id: int | None.
    • target_position: Point2 | None.
    • score: float.

detect_chessboard(...) -> None | dict:

  • detection: TargetDetection.
  • inliers: list[int] (indices into detection.corners).
  • orientations: [float, float] | None.
  • debug:
    • orientation_histogram: {"bin_centers": list[float], "values": list[float]} | None.
    • graph: {"nodes": list[{"position": Point2, "neighbors": list[{"index": int, "direction": str, "distance": float}]}]} | None.

detect_charuco(...) -> dict:

  • detection: TargetDetection.
  • markers: list of MarkerDetection.
  • alignment: GridAlignment.

MarkerDetection:

  • id: int.
  • gc: {"gx": int, "gy": int}.
  • rotation: int.
  • hamming: int.
  • score: float.
  • border_score: float.
  • code: int (packed marker bits).
  • inverted: bool.
  • corners_rect: [Point2, Point2, Point2, Point2] (TL, TR, BR, BL).
  • corners_img: [Point2, Point2, Point2, Point2] | None (TL, TR, BR, BL).

GridAlignment:

  • transform: {"a": int, "b": int, "c": int, "d": int}.
  • translation: [int, int].

detect_marker_board(...) -> None | dict:

  • detection: TargetDetection.
  • inliers: list[int].
  • circle_candidates: list of CircleCandidate.
  • circle_matches: list of CircleMatch.
  • alignment: GridAlignment | None.
  • alignment_inliers: int.

CircleCandidate:

  • center_img: Point2.
  • cell: GridCoords.
  • polarity: "white" | "black".
  • score: float.
  • contrast: float.

CircleMatch:

  • expected: MarkerCircleSpec.
  • matched_index: int | None.
  • distance_cells: float | None.
  • offset_cells: {"di": int, "dj": int} | None.

MarkerCircleSpec:

  • cell: GridCoords.
  • polarity: "white" | "black".

Examples

The example scripts load an image with Pillow (install it once):

pip install pillow
python examples/detect_chessboard.py path/to/image.png
python examples/detect_charuco.py path/to/image.png
python examples/detect_marker_board.py path/to/image.png

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

calib_targets-0.2.2.tar.gz (152.9 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

calib_targets-0.2.2-cp310-abi3-win_amd64.whl (584.5 kB view details)

Uploaded CPython 3.10+Windows x86-64

calib_targets-0.2.2-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ x86-64

calib_targets-0.2.2-cp310-abi3-macosx_11_0_arm64.whl (724.1 kB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

File details

Details for the file calib_targets-0.2.2.tar.gz.

File metadata

  • Download URL: calib_targets-0.2.2.tar.gz
  • Upload date:
  • Size: 152.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for calib_targets-0.2.2.tar.gz
Algorithm Hash digest
SHA256 dd43edfc1eb3a1473940c9482027abd68648abbf14bb16e2dc5602209aab8490
MD5 f9ea76d984090bab7f7fe351331ff833
BLAKE2b-256 68999714b8834fbca22a96f69e4bbd7437a73c0820facb790646a6d135a9e159

See more details on using hashes here.

Provenance

The following attestation bundles were made for calib_targets-0.2.2.tar.gz:

Publisher: release-pypi.yml on VitalyVorobyev/calib-targets-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file calib_targets-0.2.2-cp310-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for calib_targets-0.2.2-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 32eedcd661db4d9d6fc9b37c4a8b04f53164234547e062dc8975a32d9d26c56e
MD5 0c197ab9e87e0a2c45e4783db4245b9b
BLAKE2b-256 31839a989ed39b8f1643d8c4ecd9c1275a412e6d1ac1a399484c0fc39d3cbedb

See more details on using hashes here.

Provenance

The following attestation bundles were made for calib_targets-0.2.2-cp310-abi3-win_amd64.whl:

Publisher: release-pypi.yml on VitalyVorobyev/calib-targets-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file calib_targets-0.2.2-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for calib_targets-0.2.2-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 da2b741eaf612c2bf3e95b8f794c3c69aca91a44a37f58300b19cb57be4f7a6b
MD5 4157d32485a9e2bbd9edcd214de17026
BLAKE2b-256 54a5df300291aad2983ec63688ed28dac7c4916efd54bf2ec7f69ac2eb762555

See more details on using hashes here.

Provenance

The following attestation bundles were made for calib_targets-0.2.2-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release-pypi.yml on VitalyVorobyev/calib-targets-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file calib_targets-0.2.2-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for calib_targets-0.2.2-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 98bed5bcc6d2077a9f1166c5646cd945471ada079e8974b89330c6765d16b1a2
MD5 9653804a1c7ba090d2ada42bb37b7e6c
BLAKE2b-256 b71ec81834b9dda0a1aeba84645ed653260f9046e94f13cc1a29309dac969763

See more details on using hashes here.

Provenance

The following attestation bundles were made for calib_targets-0.2.2-cp310-abi3-macosx_11_0_arm64.whl:

Publisher: release-pypi.yml on VitalyVorobyev/calib-targets-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page