doesn't like apriltag images I take for some reason grrrr

This commit is contained in:
Tyler-J42 committed 2024-07-18 05:12:39 -04:00
1 parent 8e1d62a322
commit a652fae56f
21 files changed
+48862 -12

No files matched your search

+1 -1
View File
@@ -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()
+1 -1
View File
@@ -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})
+14 -8
View File
@@ -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)
Binary file not shown.

Before

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 258 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 70 KiB

After

Width:  |  Height:  |  Size: 210 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 62 KiB

After

Width:  |  Height:  |  Size: 288 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 MiB

Binary file not shown.
+16288
View File
File diff suppressed because it is too large. Load diff
BIN
View File
Binary file not shown.
+16267
View File
File diff suppressed because it is too large. Load diff
Binary file not shown.
+16289
View File
File diff suppressed because it is too large. Load diff
Binary file not shown.
Binary file not shown.
BIN
View File
Binary file not shown.
Binary file not shown.
Binary file not shown.