-3

Is it possible to convert RGB image to RGB+NIR image?

1 Answers1

1

You can use OpenCV like this:

import cv2

fourChannel = cv2.cvtColor(threeChannel, cv2.COLOR_RGB2RGBA)

Or you can use Numpy to make a new, empty channel of same size and type as your original, and stack it onto your 3 channel image:

import numpy as np

newEmpty = np.zeros_like(threeChannel[...,0])
fourChannel = np.dstack((threeChannel, newEmpty))
Mark Setchell
  • 191,897
  • 31
  • 273
  • 432