logo

OPENMV如何在程序中读取电脑中存储的本地图片的问题

2018-06-21 15:21
M
_15529663967

import sensor, image, time

thresholds = [(30, 100, 15, 127, 15, 127)]

sensor.reset()

sensor.set_pixformat(sensor.RGB565)

sensor.set_framesize(sensor.QVGA)

sensor.skip_frames(time = 2000)

sensor.set_auto_gain(False) # must be turned off for color tracking

sensor.set_auto_whitebal(False) # must be turned off for color tracking

img = ######写什么函数 读取指定路径的本地图片#############读取电脑中储存的截图

b = img.find_blobs(thresholds, pixels_threshold=200, area_threshold=200)

print(b.pixels()) #输出该图片中特点颜色的像素点个数

上面代码中 img = #########################读取电脑中储存的本地图片

如何实现读取本地图片?

回复 引用 0

2018-06-21 16:07
X
Yuan

img = image.Image("/example.jpg")

2018-06-21 17:16
I
网红小智智 星瞳科技

https://forum.singtown.com/topic/754/%E8%AF%BB%E7%89%87%E8%AF%BB%E5%8F%96