0

I'm currently using Keras' image pre-processing functions to augment some training image data. As part of this I'm trying to visualise the augmentations which can be done by saving the images to a directory using the flow method from the ImageDataGenerator class:

https://keras.io/preprocessing/image/#flow

datagenerator.flow(image, batch_size=1, save_to_dir=args["imgdir"], save_prefix='aug',
                   save_format='png')

The problem is that the images I pass in are RGB and the images saved in the directory are BGR. The only transform that I'm doing is a rotation, why is it converting them to BGR? I can remedy the situation by converting the image to BGR before passing it to the generator flow method.

The generator itself is not producing BGR images - those remain in RGB format, they're just being converted when they're saved.

William Smith
  • 89
  • 1
  • 10

1 Answers1

0

The mismatch in channels might be due to the libraries that you are using to load and store the images. Checking this would help you solve this problem.