mirror of
https://github.com/openmv/openmv.git
synced 2025-09-26 23:09:13 +08:00
28 lines
576 B
Python
28 lines
576 B
Python
# Copy image to framebuffer.
|
|
#
|
|
# This example shows how to load and copy an image to framebuffer for testing.
|
|
|
|
import sensor, image, time
|
|
|
|
# Still need to init sensor
|
|
sensor.reset()
|
|
# Set sensor settings
|
|
sensor.set_contrast(1)
|
|
sensor.set_gainceiling(16)
|
|
|
|
# Set sensor pixel format
|
|
sensor.set_framesize(sensor.QQVGA)
|
|
sensor.set_pixformat(sensor.GRAYSCALE)
|
|
|
|
# Load image
|
|
img = image.Image("/example.bmp", copy_to_fb=True)
|
|
|
|
# Add drawing code here.
|
|
# img.draw_line(...)
|
|
|
|
# Flush FB
|
|
sensor.flush()
|
|
|
|
# Add a small delay to allow the IDE to read the flushed image.
|
|
time.sleep(100)
|