def Luv_to_chroma_hue(luv):
''' Converts L*u*v* coordiantes to a chroma and hue.
Args:
luv (`numpy.ndarray`): array with last dimension L*, u*, v*.
Returns:
`numpy.ndarray` with last dimension corresponding to C* and h.
'''
luv = np.asarray(luv)
u, v = luv[..., 1], luv[..., 2]
C = sqrt(u**2 + v**2)
h = atan2(v, u)
shape = luv.shape
return np.stack((C, h), axis=len(shape))
评论列表
文章目录