tof_camera.py

# Esta obra está licenciada bajo la licencia MIT.
# Copyright (c) 2013-2023 OpenMV LLC. Todos los derechos reservados.
# https://github.com/openmv/openmv/blob/master/LICENSE
#
# Demostración de cámara de tiempo de vuelo.

import image
import time
import tof

IMAGE_SCALE = 10  # Escala la imagen 10x.

# Inicializa el sensor ToF
tof.init()  # Detecta automáticamente el sensor conectado.

# Reloj de FPS
clock = time.clock()

while True:
    clock.tick()

    try:
        img = tof.snapshot(
            vflip=True,
            hmirror=True,
            x_scale=IMAGE_SCALE,
            y_scale=IMAGE_SCALE,
            hint=image.BILINEAR,
            scale=(0, 4000),
            copy_to_fb=True,
            color_palette=image.PALETTE_DEPTH,
        )
    except RuntimeError:
        continue

    print(clock.fps())

results matching ""

    No results matching ""