Can anyone create a code using only opencv and numpy that generates the image of an HSV disk of size 500 x 500, similar to the image below: HSV DISK
I tried a few times but I can't do it, the disc wasn't coming out with all the colors
Can anyone create a code using only opencv and numpy that generates the image of an HSV disk of size 500 x 500, similar to the image below: HSV DISK
I tried a few times but I can't do it, the disc wasn't coming out with all the colors
Copyright © 2021 Jogjafile Inc.
Updated Answer
I found some time to make more of an answer. It is not perfect, but it should be 95% of what you want, and you can fiddle with it to get the rotation, scaling and saturation you want:
Original Answer
I don't have time at the minute to write the code for you, but you would want to make 3 separate grayscale images like this:
Hue (H):
Saturation (S): (solid white):
Value (V): (solid mid-grey):
Then depth-stack them together to make a 3-channel HSV from the three individual H, S and V channels:
Then convert to BGR:
That will make this:
Remember that the Hue channel should be a np.uint8 and range from 0..180, rather than the 0..360 you might expect. This is to ensure it fits in the range of an unsigned char.