I generate some bmp image from cifar lmdb database using opencv. But when reading bmp, exception throws out: “OSError: Unexpected value read!”
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("/viscifar/rgb.bmp")
# 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)