
import sensor, image, time
# 仍然需要初始化 sensor
sensor.reset()
# 设置 sensor
sensor.set_contrast(1)
sensor.set_gainceiling(16)
# 设置sensor的 pixel format
sensor.set_framesize(sensor.QQVGA)
sensor.set_pixformat(sensor.GRAYSCALE)
# 导入 image
img = image.Image("/example.bmp", copy_to_fb=True)
# 添加画线的代码
# img.draw_line(...)
# Flush FB
sensor.flush()
# Add a small delay to allow the IDE to read the flushed image.
time.sleep(100)你的example.bmp在OpenMV插入的SD卡里?

你的bmp图片格式不对。
@kidswong999 应该是什么呢??不是bmp吗?
要在软件里导出bmp,而不是直接改后缀名。
@kidswong999 我的确是从软件里导出的呀。。。
微软的画图软件里,导出24位的格式。

photoshop也可以。


@kidswong999 谢谢老哥,整好啦!!!:face_with_stuck-out_tongue:
@kidswong999 你好,通过这两种方式处理的图片,依然无法读取,有其他办法吗?