thermal_camera.py

# Ce travail est publié sous licence MIT.
# Copyright (c) 2013-2023 OpenMV LLC. Tous droits réservés.
# https://github.com/openmv/openmv/blob/master/LICENSE
#
# Démonstration de caméra thermique
#
# Cet exemple montre comment superposer une carte de chaleur sur
# la sortie vidéo en direct de la caméra principale de votre OpenMV Cam.

import image
import time
import fir

IMAGE_SCALE = 5  # Mettre l'image à l'échelle x5.
drawing_hint = image.BICUBIC  # ou image.BILINEAR ou 0 (plus proche voisin)

# Initialiser le capteur thermique
fir.init()
w = fir.width()
h = fir.height()

if fir.type() == fir.FIR_AMG8833:
    IMAGE_SCALE = IMAGE_SCALE * 2

# Horloge FPS
clock = time.clock()

while True:
    clock.tick()

    try:
        img = fir.snapshot(
            x_scale=IMAGE_SCALE,
            y_scale=IMAGE_SCALE,
            color_palette=image.PALETTE_IRONBOW,
            hint=drawing_hint,
            copy_to_fb=True,
        )
    except OSError:
        continue

    # Afficher le FPS.
    print(clock.fps())

results matching ""

    No results matching ""