在 MicroPython 函数库 » image — 机器视觉。里面有这样一个函数:image.binary_to_rgb(binary_image_value),作用是返回二进制值(0-1)对应的RGB888格式的元组(r, g, b)。这个函数参数是什么啊?文档里面就没有说。
这一个函数,不是方法,就是一个公式。参数就是要计算的参数。
import image
print(image.binary_to_rgb(0))
print(image.binary_to_rgb(255))结果:
>>> (0, 0, 0)
(255, 255, 255)