0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

CharucoBoardつくーる(Windows 10、OpenCV 4.0.0、Python 3.6.12)

Posted at

開発環境

  • Windows 10 PC
  • OpenCV 4.0.0
  • Python 3.6.12
  • ImageMagick-7.1.0-16-Q16-HDRI-x64-dll.exe

実装

1.ImageMagickのインストール

2.下記コードを実行

CreateCharucoBoard.py
import cv2
import subprocess

aruco = cv2.aruco
dictionary = aruco.getPredefinedDictionary(aruco.DICT_6X6_250)
charucoBoard = aruco.CharucoBoard_create(5, 7, 0.04, 0.02, dictionary)
image = charucoBoard.draw((round(5 * 40 / 25.4 * 350), round(7 * 40 / 25.4 * 350)))
cv2.imwrite("charuco_board.png", image)
subprocess.run(['magick.exe', 'convert', '-density', '350', '-units', 'pixelsperinch', 'charuco_board.png', 'charuco_board.png'])

charuco_board.png

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?