Shortcuts

mmcv.image.adjust_lighting

mmcv.image.adjust_lighting(img, eigval, eigvec, alphastd=0.1, to_rgb=True)[source]

AlexNet-style PCA jitter.

This data augmentation is proposed in ImageNet Classification with Deep Convolutional Neural Networks.

Parameters
  • img (ndarray) – Image to be adjusted lighting. BGR order.

  • eigval (ndarray) – the eigenvalue of the convariance matrix of pixel values, respectively.

  • eigvec (ndarray) – the eigenvector of the convariance matrix of pixel values, respectively.

  • alphastd (float) – The standard deviation for distribution of alpha. Defaults to 0.1

  • to_rgb (bool) – Whether to convert img to rgb.

Returns

The adjusted image.

Return type

ndarray