image_drawing.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
#
# Ejemplo de dibujo de imagen
#
# Este ejemplo muestra cómo dibujar imágenes en el framebuffer.
import csi
import time
import image
csi0 = csi.CSI()
csi0.reset()
csi0.pixformat(csi.RGB565) # o GRAYSCALE...
csi0.framesize(csi.QVGA) # o QQVGA...
csi0.snapshot(time=2000)
clock = time.clock()
while True:
clock.tick()
img = csi0.snapshot()
small_img = img.scale(x_scale=0.25, y_scale=0.25, hint=image.AREA, copy=True)
x = (img.width() // 2) - (small_img.width() // 2)
y = (img.height() // 2) - (small_img.height() // 2)
# Dibuja una imagen en el framebuffer. Pase una máscara
# de imagen opcional para controlar qué píxeles se dibujan.
img.draw_image(small_img, x, y, x_scale=1, y_scale=1)
print(clock.fps())