Search code examples
tensorflowbatch-processingimage-whitening

How to perform tf.image.per_image_standardization on a batch of images in tensorflow


I would like to know how to perform image whitening on a batch of images.

According to the documentation in https://www.tensorflow.org/api_docs/python/tf/image/per_image_standardization, it is said that tf.image.per_image_standardization takes as input a 3D tensor, that is an image, of shape: [height, width, channels].

Is it a missing feature or there is a different method?

Any help is much appreciated.


Solution

  • This is how to perform this operation on a batch of images.

    tf.map_fn(lambda frame: tf.image.per_image_standardization(frame), frames)