Skip to content

Commit

Permalink
DetectorParameters
Browse files Browse the repository at this point in the history
  • Loading branch information
previ committed Mar 17, 2024
1 parent 169119e commit b6f78a7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions coderbot/cv/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ class Image():
r_from = np.float32([[0, 0], [640, 0], [640, 480], [0, 480]])
r_dest = np.float32([[0, -120], [640, -120], [380, 480], [260, 480]])

_aruco_dict = cv2.aruco.getPredefinedDictionary(cv2.aruco.DICT_ARUCO_ORIGINAL)
_aruco_parameters = cv2.aruco.DetectorParameters_create()
_aruco_detector = cv2.aruco.DetectorParameters(
cv2.aruco.getPredefinedDictionary(cv2.aruco.DICT_ARUCO_ORIGINAL),
cv2.aruco.DetectorParameters())

_face_cascade = cv2.CascadeClassifier(cv2.data.haarcascades + 'haarcascade_frontalface_default.xml')

Expand Down Expand Up @@ -254,7 +255,7 @@ def find_qr_code(self):

def find_ar_code(self):
gray = cv2.cvtColor(self._data, cv2.COLOR_BGR2GRAY)
corners, ids, rejectedImgPoints = cv2.aruco.detectMarkers(gray, self._aruco_dict, parameters=self._aruco_parameters)
corners, ids, rejectedImgPoints = self._aruco_detector.detectMarkers(gray)
codes = []
positions = []
if ids is not None:
Expand Down

0 comments on commit b6f78a7

Please sign in to comment.