logo

lab转RGB函数报错lab_to_rgb()

2020-12-27 22:32
D
ug4p

def colorfunc():

img = sensor.snapshot() # Take a picture and return the image.

statistics=img.get_statistics(roi=ROI)

color_l=statistics.l_mode()

color_a=statistics.a_mode()

color_b=statistics.b_mode()

print(color_l,color_a,color_b)

rgb=img.lab_to_rgb(color_l,color_a,color_b)

print(rgb)

img.draw_rectangle(ROI)

632ceec2-5876-4490-b714-7d8b35957f53.jpg
2020-12-28 15:29
I
网红小智智 星瞳科技

lab_to_rgb是一个函数,不是image对象的方法。

可以运行的代码:

import image
print(image.lab_to_rgb((22, -26, 23)))
2020-12-28 16:56
D
ug4p

@kidswong999 谢谢,我试一下