Farbumkehrung der ChArUco-MarkerPython

Python-Programme
Anonymous
 Farbumkehrung der ChArUco-Marker

Post by Anonymous »

Können wir die ChArUco-Marker erkennen, nachdem wir die Farbe der ChArUco-Marker invertiert haben? Mein Kunde möchte die farblich umgekehrte ChArUco-Platte. Ist das eine gute Idee?

Code: Select all

import os
import numpy as np
import cv2

# ------------------------------
# ENTER YOUR PARAMETERS HERE:
ARUCO_DICT = cv2.aruco.DICT_6X6_250
SQUARES_VERTICALLY = 7
SQUARES_HORIZONTALLY = 5
SQUARE_LENGTH = 0.008
MARKER_LENGTH = 0.006
LENGTH_PX = 640   # total length of the page in pixels
MARGIN_PX = 20    # size of the margin in pixels
SAVE_NAME = 'ChArUco_Marker.png'
# ------------------------------

def create_and_save_new_board():
dictionary = cv2.aruco.getPredefinedDictionary(ARUCO_DICT)
board = cv2.aruco.CharucoBoard((SQUARES_VERTICALLY, SQUARES_HORIZONTALLY), SQUARE_LENGTH, MARKER_LENGTH, dictionary)
size_ratio = SQUARES_HORIZONTALLY / SQUARES_VERTICALLY
img = cv2.aruco.CharucoBoard.generateImage(board, (LENGTH_PX, int(LENGTH_PX*size_ratio)), marginSize=MARGIN_PX)
cv2.imshow("img", img)
cv2.waitKey(2000)
cv2.imwrite(SAVE_NAME, img)

create_and_save_new_board()

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post