- The ‘demosaic’ function transforms a Bayer pattern encoded image into a true color RGB image, based on the specified sensor alignment. For further information on this function, refer to this documentation: https://www.mathworks.com/help/images/ref/demosaic.html .
- Once the images are in RGB format, they can be used as input for a CNN by creating an input layer. To do this, use the 'imageInputLayer' function. This function requires the image size as input and creates a layer that is compatible with CNN. For further information on this function, refer to this documentation: https://www.mathworks.com/help/deeplearning/ref/nnet.cnn.layer.imageinputlayer.html