✨
This commit is contained in:
@ -1,20 +1,29 @@
|
||||
import cv2
|
||||
import robot
|
||||
|
||||
def main():
|
||||
arlo = robot.Robot()
|
||||
def find_aruco(arlo):
|
||||
image = arlo.take_photo()
|
||||
|
||||
aruco_dict = cv2.aruco.Dictionary_get(cv2.aruco.DICT_6X6_250)
|
||||
aruco_params = cv2.aruco.DetectorParameters_create()
|
||||
detected = cv2.aruco.detectMarkers(
|
||||
corners, ids = cv2.aruco.detectMarkers(
|
||||
image,
|
||||
aruco_dict,
|
||||
parameters=aruco_params
|
||||
)
|
||||
print("Corners: ", detected[0])
|
||||
print("Ids: ", detected[1])
|
||||
print("Rejected: ", detected[0])
|
||||
print("Rejected: ", detected[2])
|
||||
|
||||
for bounding, n in zip(corners, ids):
|
||||
cv2.line(image, bounding[0], bounding[1], (0,255,0))
|
||||
|
||||
return image
|
||||
|
||||
def main():
|
||||
arlo = robot.Robot()
|
||||
image = find_aruco(arlo)
|
||||
cv2.imwrite("test.png", image)
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
Reference in New Issue
Block a user