doesn't like apriltag images I take for some reason grrrr
@ -4,7 +4,7 @@
|
||||
|
||||
import time
|
||||
import cv2
|
||||
import apriltag
|
||||
import dt_apriltags
|
||||
import numpy as np
|
||||
from math import sqrt
|
||||
from math import pi
|
||||
|
@ -4,7 +4,7 @@ import os
|
||||
|
||||
stream = Picam2Vid((1536, 864))
|
||||
|
||||
path = "/home/tyler/Desktop/FRC-Apriltag-Pose-Detection/FRC_Fiducial_Tracking/Calibration_Pics_Wide_1536x864/"
|
||||
path = "/home/tyler/Desktop/FRC-Apriltag-Pose-Detection/FRC_Fiducial_Tracking/Static_Tag_Pics/"
|
||||
|
||||
stream.update()
|
||||
frame = stream.read()
|
||||
@ -13,5 +13,5 @@ cv2.waitKey(2)
|
||||
confirmation = input("keep y or n: ")
|
||||
if confirmation == "y":
|
||||
file_order = len(os.listdir(path))
|
||||
cv2.imwrite(path+str(file_order)+".jpg", frame)
|
||||
cv2.imwrite(path+str(file_order)+".png", frame)
|
||||
stream.stop()
|
||||
|
@ -11,7 +11,7 @@ class Picam2Vid:
|
||||
# For specs - https://www.raspberrypi.com/documentation/accessories/camera.html
|
||||
self.camera = Picamera2()
|
||||
self.resolution = camera_res
|
||||
config = self.camera.create_video_configuration(main={"size": self.resolution, "format": "RGB888"}, transform=Transform(hflip=True), lores={"size": (640,480)}, encode='main')
|
||||
config = self.camera.create_video_configuration(main={"size": self.resolution}, transform=Transform(hflip=True), lores={"size": (640,480)}, encode='main')
|
||||
#config = self.camera.create_video_configuration(raw={"size":camera_res})
|
||||
self.camera.configure(config)
|
||||
self.camera.set_controls({"FrameRate": 120})
|
||||
|
@ -1,19 +1,25 @@
|
||||
import apriltag
|
||||
import dt_apriltags
|
||||
import numpy as np
|
||||
import cv2
|
||||
|
||||
options = apriltag.DetectorOptions(families='tag36h11', border=1, nthreads=1,
|
||||
quad_decimate=2.0, quad_blur=0.0, refine_edges=True,
|
||||
refine_decode=False, refine_pose=False, debug=False, quad_contours=True)
|
||||
detector = apriltag.Detector(options)
|
||||
detector = dt_apriltags.Detector(searchpath=['apriltags'],
|
||||
families='tag36h11',
|
||||
nthreads=2,
|
||||
quad_decimate=1.0,
|
||||
quad_sigma=0.0,
|
||||
refine_edges=1,
|
||||
decode_sharpening=0.25,
|
||||
debug=1)
|
||||
|
||||
image = cv2.imread("/home/tyler/Desktop/FRC-Apriltag-Pose-Detection/FRC_Fiducial_Tracking/Static_Tag_Pics/2.jpg")
|
||||
image = cv2.imread("/home/tyler/Desktop/FRC-Apriltag-Pose-Detection/FRC_Fiducial_Tracking/Static_Tag_Pics/bw_img.png")
|
||||
|
||||
tagFrame = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
|
||||
|
||||
cv2.imshow("frame", tagFrame)
|
||||
print(tagFrame.dtype)
|
||||
|
||||
cv2.imshow("frame", image)
|
||||
cv2.waitKey(0)
|
||||
|
||||
output = detector.detect(tagFrame)
|
||||
output = detector.detect(tagFrame, estimate_tag_pose=False, camera_params=None, tag_size=None)
|
||||
|
||||
print(output)
|
Before Width: | Height: | Size: 72 KiB |
BIN
FRC_Fiducial_Tracking/Static_Tag_Pics/1.jpg
Normal file
After Width: | Height: | Size: 258 KiB |
Before Width: | Height: | Size: 70 KiB After Width: | Height: | Size: 210 KiB |
Before Width: | Height: | Size: 62 KiB After Width: | Height: | Size: 288 KiB |
BIN
FRC_Fiducial_Tracking/Static_Tag_Pics/4.png
Normal file
After Width: | Height: | Size: 1.9 MiB |