Skip to main content

A simple OpenCV pattern generation python package

Project description

OpenCV pattern generation tool

Lifted mainly from opencv/doc/pattern_tools. A really simple way to generate some patterns.

Added some extra utilities like YAML files, loading from YAML files etc

Installation

pip install opencv-pattern

Usage

usage: pattern [-H] [--from_config FROM_CONFIG] [-o OUTPUT] [-c COLUMNS] [-r ROWS] [-T {circles,acircles,checkerboard,radon_checkerboard,charuco_board}]
               [-u {mm,inches,px,m}] [-s SQUARE_SIZE] [-R RADIUS_RATE] [-w PAGE_WIDTH] [-h PAGE_HEIGHT] [-a {A0,A1,A2,A3,A4,A5}]
               [-m MARKERS [MARKERS ...]] [-p ARUCO_MARKER_SIZE] [-f DICT_FILE]

generate camera-calibration pattern

options:
  -H, --help            show help
  --from_config FROM_CONFIG
                        generate pattern from config
  -o OUTPUT, --output OUTPUT
                        output file
  -c COLUMNS, --columns COLUMNS
                        pattern columns
  -r ROWS, --rows ROWS  pattern rows
  -T {circles,acircles,checkerboard,radon_checkerboard,charuco_board}, --type {circles,acircles,checkerboard,radon_checkerboard,charuco_board}
                        type of pattern
  -u {mm,inches,px,m}, --units {mm,inches,px,m}
                        length unit
  -s SQUARE_SIZE, --square_size SQUARE_SIZE
                        size of squares in pattern
  -R RADIUS_RATE, --radius_rate RADIUS_RATE
                        circles_radius = square_size/radius_rate
  -w PAGE_WIDTH, --page_width PAGE_WIDTH
                        page width in units
  -h PAGE_HEIGHT, --page_height PAGE_HEIGHT
                        page height in units
  -a {A0,A1,A2,A3,A4,A5}, --page_size {A0,A1,A2,A3,A4,A5}
                        page size, superseded if -h and -w are set
  -m MARKERS [MARKERS ...], --markers MARKERS [MARKERS ...]
                        list of cells with markers for the radon checkerboard. Marker coordinates as list of numbers: -m 1 2 3 4 means markers in cells
                        [1, 2] and [3, 4]
  -p ARUCO_MARKER_SIZE, --marker_size ARUCO_MARKER_SIZE
                        aruco markers size for ChAruco pattern (default 10.0)
  -f DICT_FILE, --dict_file DICT_FILE
                        file name of custom aruco dictionary for ChAruco pattern

Config

Generates a pattern with the config.

pattern --from_config /path/to/config

Checkerboard

pattern -T checkerboard -s 5 -u mm --output checkerboard.svg

"Checkerboard image"

columns: 8
from_config: null
output: checkerboard.svg
p_type: checkerboard
page_size: A4
radius_rate: 5.0
rows: 11
square_size: 5.0
units: mm

Circles

pattern -T circles -s 5 -u mm --output circles.svg

"Circles image"

columns: 8
from_config: null
output: circles.svg
p_type: circles
page_size: A4
radius_rate: 5.0
rows: 11
square_size: 5.0
units: mm

Acircles

pattern -T acircles -s 5 -u mm --output acircles.svg

"acircles image"

columns: 8
from_config: null
output: acircles.svg
p_type: acircles
page_size: A4
radius_rate: 5.0
rows: 11
square_size: 5.0
units: mm

Radon checkerboard

pattern -T radon_checkerboard -s 5 -u mm --output radon_checkerboard.svg

"radon_checkerboard image"

columns: 8
from_config: null
output: radon_checkerboard.svg
p_type: radon_checkerboard
page_size: A4
radius_rate: 5.0
rows: 11
square_size: 5.0
units: mm

Charuco board

pattern -T charuco_board --dict_file DICT_ARUCO_ORIGINAL.json.gz --output charuco_board.svg

You can either choose one of:

  • DICT_4X4_50.json.gz
  • DICT_4X4_100.json.gz
  • DICT_4X4_250.json.gz
  • DICT_4X4_1000.json.gz
  • DICT_5X5_50.json.gz
  • DICT_5X5_100.json.gz
  • DICT_5X5_250.json.gz
  • DICT_5X5_1000.json.gz
  • DICT_6X6_50.json.gz
  • DICT_6X6_100.json.gz
  • DICT_6X6_250.json.gz
  • DICT_6X6_1000.json.gz
  • DICT_7X7_50.json.gz
  • DICT_7X7_100.json.gz
  • DICT_7X7_250.json.gz
  • DICT_7X7_1000.json.gz
  • DICT_APRILTAG_16h5.json.gz
  • DICT_APRILTAG_25h9.json.gz
  • DICT_APRILTAG_36h10.json.gz
  • DICT_APRILTAG_36h11.json.gz
  • DICT_ARUCO_ORIGINAL.json.gz

or your own personal dict file.

"Charuco image"

aruco_marker_size: 10.0
columns: 8
dict_file: DICT_ARUCO_ORIGINAL.json.gz
from_config: null
output: charuco_board.svg
p_type: charuco_board
page_size: A4
radius_rate: 5.0
rows: 11
square_size: 20.0
units: mm

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

opencv_pattern-0.1.3.tar.gz (38.3 kB view details)

Uploaded Source

Built Distribution

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

opencv_pattern-0.1.3-py3-none-any.whl (38.7 kB view details)

Uploaded Python 3

File details

Details for the file opencv_pattern-0.1.3.tar.gz.

File metadata

  • Download URL: opencv_pattern-0.1.3.tar.gz
  • Upload date:
  • Size: 38.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for opencv_pattern-0.1.3.tar.gz
Algorithm Hash digest
SHA256 515b6fa06ce49a4bb7f7746500c0f135192eb2cb49ad7a75ffcc0647bb09f563
MD5 2c0e8a16e458ca28057e584bd40e95d1
BLAKE2b-256 325aa88aec5e71451af3a697fd1d7201c177d7116d8c70e1027daec456a3c4fc

See more details on using hashes here.

File details

Details for the file opencv_pattern-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: opencv_pattern-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 38.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for opencv_pattern-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 21854849a28cfa574460c22c0efb55ad5f547edd6c2123af0202dde33fef9547
MD5 9ecfd471c031c63be5dff99bb7a277ad
BLAKE2b-256 d1935f2ebe71ce63cbce975fad6a2286e55246ec955e4aded866395d63c9f5ed

See more details on using hashes here.

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