问题
I'm converting RGB triplets to LAB in this way.
from colormath.color_objects import sRGBColor, LabColor
from colormath.color_conversions import convert_color
for p in range(0,h):
for q in range(0,w):
rgb_color = sRGBColor(img_arr[p][q][0],img_arr[p][q][1],img_arr[p][q][2])
lab_color = convert_color(rgb_color, LabColor)
But this method is slow. Is there a way I can convert img_arr
from RGB to LAB without loops? I want to use colormath
only.
来源:https://stackoverflow.com/questions/37608210/how-to-convert-a-numpy-array-of-rgb-values-to-lab-values-with-colormath-color-co