logo

openmv有没有一个函数可以将RGB图像转换成灰度图?如果没有那么PIL的模块有没有?能不能直接导入

2021-03-25 18:09
1
igkg

import sensor, image, tv

from PIL import Image

sensor.reset() # Initialize the camera sensor.

sensor.set_pixformat(sensor.RGB565) # or sensor.GRAYSCALE

sensor.set_framesize(sensor.QQVGA)

tv.init() # Initialize the tv.

while(True):

img = sensor.snapshot()

img.convert('L')

tv.display(img)

2021-03-25 18:39
I
网红小智智 星瞳科技

https://docs.singtown.com/micropython/zh/latest/openmvcam/library/omv.image.html#image.to_grayscale