def bgr2hsvcone(img):
arr_hsv = cv2.cvtColor(img, cv2.COLOR_BGR2HSV)
h = arr_hsv[..., 0] / 180. * 2
s = arr_hsv[..., 1] / 255.
v = arr_hsv[..., 2] / 255.
x = np.cos(h * np.pi) * s * v
y = np.sin(h * np.pi) * s * v
return np.stack((x, y, v), axis=-1)