-2

I have data stored in this format

img01_blue.tif
img01_yellow.tif
img01_red.tif
...    
imgn_blue.tif
imgn_yellow.tif
imgn_red.tif

with each images being split into 3 images with different channels, indicated by their suffixes.

Now I want to feed them to CNN built by Keras - Python. Because the data is large and already structured, I feed them in batch by ImageGenerator and flow_from_directory without preprocessing by beforehand.

I want to merge multiple files into 1 single input, each in different channels, can I do that using Keras tool or I have to preprocess the data by other packages first?

Thanh Nguyen
  • 902
  • 2
  • 12
  • 31
  • Unfortunately this question does not show any research effort. Have you tried any pre-processing? Load the images, merge them and save it as single images. There are [posts](https://stackoverflow.com/questions/19673619/save-raw-data-as-tif) to read and write tiff images with NumPy. – nuric May 29 '18 at 16:54
  • I have edited to clarify my issue – Thanh Nguyen May 29 '18 at 17:19

1 Answers1

1

The ImageGenerator.flow_from_directory assumes you have single image files. You will have to pre-process your data and merge the files into a single one. If you like to keep the files separate, then you will have to write your own data generator that handles the data you have. But it would wiser to pre-process, here is a post that provides a starting point.

nuric
  • 11,027
  • 3
  • 27
  • 42