I have two PCB defect images illuminated by different light sources. The content is the same, only the light sources are different. I found that different defects appear differently under different light sources; some are more obvious while others are not so obvious. Therefore, I want to combine these two images into a 6-channel TIFF file for training.
I’ve never done this, but you could try using the cv2.merge function to stack all 6 channels into a single image, see the docs here. Additionally, you could just combine the images by using the cv2.addWeighted which would result in a 3-channel image that is a combination of both images; tutorial here. I’m not 100% certain, but unless all your training images will have 6-channels, you likely want to use cv2.addWeighted so that you have a 3-channel image. I’m only guessing here, but if you try to use a single 6-channel image amongst a collection of 3-channel images, it will either get truncated to the first 3-channels or thrown out since it doesn’t match the others.
You can also check the code shown in the note here. You need to merge them so that they’re in the format (C, H, W) and not (H, W, C)