-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit afeed54
Showing
5 changed files
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import cv2 as cv | ||
import numpy as np | ||
|
||
# Load the predefined dictionary | ||
dictionary = cv.aruco.Dictionary_get(cv.aruco.DICT_6X6_250) | ||
|
||
# Generate the marker | ||
markerImage = np.zeros((200, 200), dtype=np.uint8) | ||
markerImage = cv.aruco.drawMarker(dictionary, 33, 200, markerImage, 1) | ||
|
||
cv.imwrite("./markers/marker33.png", markerImage) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import cv2 as cv | ||
import numpy as np | ||
import pandas as pd | ||
|
||
if __name__ == '__main__': | ||
cap = cv.VideoCapture('./test.mp4') | ||
while True: | ||
success, image = cap.read() | ||
if image is None: | ||
break | ||
key = cv.waitKey(1) & 0xFF | ||
if (key == 27) or (key == ord('q')): | ||
break | ||
if success: | ||
dictionary = cv.aruco.Dictionary_get(cv.aruco.DICT_6X6_250) | ||
parameters = cv.aruco.DetectorParameters_create() | ||
markerCorners, markerIds, rejectedCandidates = cv.aruco.detectMarkers(image, | ||
dictionary, | ||
parameters=parameters) | ||
if markerIds is not None: | ||
coords = list(np.mean(markerCorners[0], axis=1)[0].astype('int')) | ||
image = cv.circle(image, coords, 20, (255, 0, 0), -1) | ||
cv.imshow("original", image) | ||
else: | ||
continue |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.