ironbow_color_tracking.py

# Dieses Werk ist unter der MIT-Lizenz lizenziert.
# Copyright (c) 2013-2024 OpenMV LLC. Alle Rechte vorbehalten.
# https://github.com/openmv/openmv/blob/master/LICENSE
#
# Einzelfarbiges RGB565-Blob-Tracking – Beispiel
#
# Dieses Beispiel demonstriert einzelfarbiges RGB565-Tracking mit der OpenMV Cam unter Verwendung des FLIR BOSON.

import csi
import time
import image

# Schwellenwerte für die Farbverfolgung (L Min, L Max, A Min, A Max, B Min, B Max)
threshold_list = [(70, 100, -30, 40, 20, 100)]

# Sensor initialisieren.
csi0 = csi.CSI()
csi0.reset()
csi0.pixformat(csi.GRAYSCALE)
csi0.framesize(csi.VGA)
csi0.color_palette(image.PALETTE_IRONBOW)
csi0.snapshot(time=5000)

clock = time.clock()

# Nur Blobs, die mehr Pixel als "pixel_threshold" und eine größere Fläche als "area_threshold" haben, werden
# von "find_blobs" unten zurückgegeben. Ändern Sie "pixels_threshold" und "area_threshold", wenn Sie die
# Kameraauflösung ändern. "merge=True" führt alle sich überlappenden Blobs im Bild zusammen.

while True:
    clock.tick()
    img = csi0.snapshot()
    for blob in img.find_blobs(
        threshold_list, pixels_threshold=200, area_threshold=200, merge=True
    ):
        img.draw_detection(blob)
    print(clock.fps())

results matching ""

    No results matching ""