Goal: I wish to merge thermal and RGB images into new 4-channel images for DNNs (perhaps pre-trained ones like YOLO) to improve detection and tracking—akin to how the computer vision of autonomous vehicles fuses multiple input sources before applying DNNs.
Question: My problem is that my new images are washed-out. The thermal channel is the alpha channel. Is there a way to use OpenCV (and Python) to change the opacity of an image's alpha channel?
My test color and thermal images are the following:
My code is the following:
import cv2
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
bgr_img = mpimg.imread("color.png")
th_img = mpimg.imread("thermal.png")
b, g, r = cv2.split(bgr_img)
bgrth_img = cv2.merge([b, g, r, th_img])
Which returns the following image:
How Do I use OpenCV and Python to change the transparency or opacity of the thermal channel as the alpha channel? Also, do you reckon that merging thermal and RBG images will increase detection and tracking accuracy?