简体   繁体   中英

HSV image formation in python

I have 3 (512×512) numpy arrays representing the Hue, Saturation and Value channels of my desired HSV image, containing float values.

How do I construct a single 512×512 image from these 3 numpy arrays?

To create an HSV image from the 3 channels, you can put them in a numpy array and transpose it to convert the shape from (3, 512, 512) to (512, 512, 3):

hsv = np.transpose([h, s, v], (1, 2, 0))

With OpenCV you can also use cv2.merge .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM