Permute image channels. By default the permutation is random (uniform over all
orderings); set channel_order to pin a fixed reordering.
channel_orderFixed permutation of channel indices.
When None (default), a random permutation is sampled each call.
When a tuple, that exact order is applied every time (length must match
the number of image channels).
Default: None.
pProbability of applying the transform. Default: 0.5.
>>> import numpy as np
>>> import albumentations as A
>>> image = np.random.randint(0, 256, (100, 100, 3), dtype=np.uint8)
>>>
>>> # Random shuffle (default)
>>> transform = A.ChannelShuffle(p=1.0)
>>> result = transform(image=image)["image"]
>>>
>>> # Fixed reorder: RGB → BGR
>>> transform = A.ChannelShuffle(channel_order=(2, 1, 0), p=1.0)
>>> result = transform(image=image)["image"]channel_order is None, the permutation is chosen uniformly
over all channel orderings; the same image can get different orderings on
different calls.channel_order is set, the transform behaves deterministically
(same as ChannelSwap).channel_order required.