CharucoBoard 첨부(Windows 10, OpenCV4.0.0, Python 3.6.12)

2965 단어 WindowsOpenCVPython
개발 환경
  • 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'])
    

    좋은 웹페이지 즐겨찾기