Python package for generating camera calibration patterns (based on OpenCV script)
Project description
camera-calibration-patterns
SVG pattern generator for camera calibration (checkerboard, radon checkerboard, circles, asymmetric circles, charuco board), packaged as a Python library and CLI.
- 📦 PyPI package:
camera-calibration-patterns - 🐍 Module:
camera_calibration_patterns - 🖥️ CLI:
generate-pattern
Based on OpenCV’s gen_pattern.py script, refactored and packaged as a standalone Python library + CLI.
🚀 Installation
Option 1: pipx (recommended for CLI use)
pipx install camera-calibration-patterns
# then:
generate-pattern -h
Option 2: pip (as a library)
pip install camera-calibration-patterns
Option 3: from GitHub
pipx install "git+https://github.com/victor1234/camera-calibration-patterns.git@v0.1.0"
Requirements:
- Python >= 3.11
🧰 CLI
Generate a 9x7 checkerboard with 25 mm square size:
generate-pattern -T checkerboard -r 9 -c 7 -s 25 -u mm -o chess_9x7_25mm.svg
Generate a 4×11 radon checkerboard with 15 mm square size:
generate-pattern -T radon_checkerboard -r 15 -c 12 -s 15 -u mm -m 5 7 5 8 6 7 radon_15x12_15mm.svg
Generate a 15×6 asymmetric circle grid with 15 mm diameter:
generate-pattern -T acircles -r 15 -c 6 -s 15 -u mm -R 3 -o acircles_15x6_15mm.svg
Show all options:
generate-pattern -h
Tip: Print SVGs with no scaling to ensure square sizes match the specified units (
mm/in).
⚙️ CLI Options
| Flag | Description | Example |
|---|---|---|
-o output |
Output SVG filename | -o pattern.svg |
-c columns |
Pattern columns | -c 9 |
-r rows |
Pattern rows | -r 7 |
-T {circles,acircles,checkerboard,radon_checkerboard,charuco_board} |
Pattern type | -T checkerboard |
-u {mm,inches,px,m} |
Units for size | -u mm |
-s square_size |
Size of squares in pattern | -s 20 |
-R radius_rate |
Circles_radius = square_size/radius_rate | -R 0.8 |
-w page_width |
Page width in units | -w 210 |
-h page_height |
Page height in units | -h 297 |
-a {A0,A1,A2,A3,A4,A5} |
Page size, supersedes -h -w arguments | -a A4 |
-m markers [markers ...] |
List of cells with markers for the radon checkerboard | -m 0 1 2 3 |
-p aruco_marker_size |
Size of ArUco markers | -p 10 |
-f dict_file |
file name of custom aruco dictionary for ChAruco pattern | -f custom_dict.yml |
-H |
Show help | -H |
License
This package is licensed under the Apache License 2.0 (see LICENSE).
This project includes code from:
gen_pattern.pyby OpenCV, licensed under the Apache License 2.0.svgfig.pyby Jim Pivarski — licensed under the BSD 3-Clause License.
The code has been modified and packaged as a Python library by Victor Kataev in 2025.
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 camera_calibration_patterns-0.1.0.tar.gz.
File metadata
- Download URL: camera_calibration_patterns-0.1.0.tar.gz
- Upload date:
- Size: 37.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.4 CPython/3.11.13 Linux/6.11.0-1018-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0a8f3eced026bf000c48fe29f71d2504f3f004a9f0a2c2dc1bf4b7868ac02ee8
|
|
| MD5 |
ff0aef31272fad965b0bc29226b078d2
|
|
| BLAKE2b-256 |
c72844327c510f983ef9f32e8dcf864c5ab7c56ac94e3f1c31312da03f300e8b
|
File details
Details for the file camera_calibration_patterns-0.1.0-py3-none-any.whl.
File metadata
- Download URL: camera_calibration_patterns-0.1.0-py3-none-any.whl
- Upload date:
- Size: 39.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.4 CPython/3.11.13 Linux/6.11.0-1018-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cda0773a40e8c1692f0efe4bc57bbbcb34407fa133ddf2a6be640be6dc8c844d
|
|
| MD5 |
9e74e7264d0d71e7fa36476a0b951309
|
|
| BLAKE2b-256 |
74d53022ea6acf47730b4a93e4562b35b1a08e3ff141ce1091e31ee013e6388a
|