一个简单的OpenCV图案生成Python包
项目描述
OpenCV图案生成工具
主要从opencv/doc/pattern_tools提取。生成一些图案的一种非常简单的方式。
添加了一些额外的实用工具,如YAML文件、从YAML文件加载等
安装
pip install opencv-pattern
使用
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
配置
使用配置生成图案。
pattern --from_config /path/to/config
棋盘格
pattern -T checkerboard -s 5 -u mm --output checkerboard.svg
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
圆圈
pattern -T circles -s 5 -u mm --output circles.svg
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
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棋盘格
pattern -T radon_checkerboard -s 5 -u mm --output radon_checkerboard.svg
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板
pattern -T charuco_board --dict_file DICT_ARUCO_ORIGINAL.json.gz --output charuco_board.svg
您可以选择以下之一:
- 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
或您自己的字典文件。
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
项目详情
下载文件
下载适用于您平台的文件。如果您不确定选择哪个,请了解有关安装包的更多信息。
源分发
opencv_pattern-0.1.1.tar.gz (38.3 kB 查看哈希值)
构建版本
opencv_pattern-0.1.1-py3-none-any.whl (38.6 kB 查看哈希值)
关闭
opencv_pattern-0.1.1.tar.gz 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 6803e3650c0206b479813e1fc2d772fc7a09aaeb2b9f3628e84d8eec9e0b3f9a |
|
MD5 | 846412a0c168c0b5ad23e98008ebd07d |
|
BLAKE2b-256 | 10dc97b3191388c1509eba6447dd957abe675883bb96157d52ac3e80781d7740 |
关闭
opencv_pattern-0.1.1-py3-none-any.whl 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 3ecc7d056ee4680925265c9703d29ef99b3fb1e71cf13859c98d9178788c4eb4 |
|
MD5 | 7b9d2b9bdeca86945e1315dab80bf677 |
|
BLAKE2b-256 | 4ec7e558cafec0b54f363a4119aee5b0af405e9d4b4f1f315283b84f42547e6c |