小编Har*_*n M的帖子

AttributeError:模块“cv2.aruco”没有属性“Dictionary_get”

AttributeError:模块“cv2.aruco”没有属性“Dictionary_get”

即使安装后

  • OpenCV-Python
  • opencv-contrib-python
import numpy as np
import cv2, PIL
from cv2 import aruco
import matplotlib.pyplot as plt
import matplotlib as mpl
import pandas as pd

vid = cv2.VideoCapture(0)

while (True):

    ret, frame = vid.read()
    #cv2.imshow('frame', frame)

    if cv2.waitKey(1) & 0xFF == ord('q'):
        break
    gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
    aruco_dict = aruco.Dictionary_get(aruco.DICT_6X6_250)
    parameters =  aruco.DetectorParameters()
    corners, ids, rejectedImgPoints = aruco.detectMarkers(gray, aruco_dict, parameters=parameters)
    frame_markers = aruco.drawDetectedMarkers(frame.copy(), corners, ids)

    plt.figure()
    plt.imshow(frame_markers)
    for i in range(len(ids)):
        c = corners[i][0]
        plt.plot([c[:, 0].mean()], [c[:, 1].mean()], …
Run Code Online (Sandbox Code Playgroud)

python opencv aruco

9
推荐指数
2
解决办法
4万
查看次数

标签 统计

aruco ×1

opencv ×1

python ×1