Fixed number of color on Chromatic Circle with cv2

19 views Asked by At

I'm trying to get a set of a specific number of colors covering all the chromatic circles using cv2.

I'm actually using this function :

hue_values = np.linspace(0, 360, nbr_max_people)
        for hue in hue_values:
            color = np.array([hue, 255, 255], dtype=np.uint8)  
            color_rgb = cv2.cvtColor(np.array([[color]], dtype=np.uint8), cv2.COLOR_HSV2BGR)[0][0]
            print(color_rgb)
            self.colors.append(tuple(map(int, color_rgb)))

It's working for the first 5 colors and then it go back to the beginning of the circle (ie. red) and get random others colors.

0

There are 0 answers