ArucoGenerator
BIN
test/data/5x5_twoFotos_10mm/DSCF0033.JPG
Executable file
|
After Width: | Height: | Size: 12 MiB |
BIN
test/data/5x5_twoFotos_10mm/DSCF0033_recognized.jpg
Normal file
|
After Width: | Height: | Size: 5.1 MiB |
BIN
test/data/5x5_twoFotos_10mm/DSCF0034.JPG
Executable file
|
After Width: | Height: | Size: 12 MiB |
BIN
test/data/5x5_twoFotos_10mm/DSCF0035.JPG
Executable file
|
After Width: | Height: | Size: 12 MiB |
BIN
test/data/5x5_twoFotos_10mm/DSCF0035_recognized.jpg
Normal file
|
After Width: | Height: | Size: 5.4 MiB |
BIN
test/data/5x5_twoFotos_10mm/DSCF0036.JPG
Executable file
|
After Width: | Height: | Size: 11 MiB |
BIN
test/data/5x5_twoFotos_10mm/DSCF1053.JPG
Executable file
|
After Width: | Height: | Size: 4.0 MiB |
BIN
test/data/5x5_twoFotos_10mm/DSCF1053_recognized.jpg
Normal file
|
After Width: | Height: | Size: 4.1 MiB |
BIN
test/data/5x5_twoFotos_10mm/DSCF1054.JPG
Executable file
|
After Width: | Height: | Size: 5.0 MiB |
BIN
test/data/5x5_twoFotos_10mm/DSCF1054_recognized.jpg
Normal file
|
After Width: | Height: | Size: 3.9 MiB |
BIN
test/data/5x5_twoFotos_10mm/calibration_XPro2_16mm_1m_f8.npz
Executable file
37
test/data/5x5_twoFotos_10mm/readAruco.py
Executable file
@@ -0,0 +1,37 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import sys
|
||||
import cv2
|
||||
|
||||
def main():
|
||||
if len(sys.argv) != 2:
|
||||
print("Usage: python3 readAruco.py input.jpg")
|
||||
sys.exit(1)
|
||||
|
||||
input_path = sys.argv[1]
|
||||
output_path = input_path.replace(".jpg", "_recognized.jpg")
|
||||
output_path = input_path.replace(".JPG", "_recognized.jpg")
|
||||
|
||||
img = cv2.imread(input_path)
|
||||
if img is None:
|
||||
print("Fehler: Bild konnte nicht geladen werden")
|
||||
sys.exit(1)
|
||||
|
||||
aruco = cv2.aruco
|
||||
dictionary = aruco.getPredefinedDictionary(aruco.DICT_5X5_250)
|
||||
|
||||
parameters = aruco.DetectorParameters_create()
|
||||
|
||||
corners, ids, rejected = aruco.detectMarkers(img, dictionary, parameters=parameters)
|
||||
|
||||
if ids is not None:
|
||||
aruco.drawDetectedMarkers(img, corners, ids)
|
||||
print(f"Gefunden: {len(ids)} Marker")
|
||||
else:
|
||||
print("Keine Marker gefunden")
|
||||
|
||||
cv2.imwrite(output_path, img)
|
||||
print("Gespeichert:", output_path)
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||