mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
* With this fix the frame buffer will be updated instantly after loading or creating new images with the copy_to_fb flag set to true. * There's no need to flush the framebuffer after loading or creating images anymore, however the sensor (or image) flush() still needs to be called after drawing to see the updates.
22 lines
501 B
Python
22 lines
501 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 a small delay to allow the IDE to read the loaded image.
|
|
time.sleep(500)
|