Shortcuts

mmcv.image.bgr2gray

mmcv.image.bgr2gray(img: numpy.ndarray, keepdim: bool = False)numpy.ndarray[source]

Convert a BGR image to grayscale image.

Parameters
  • img (ndarray) – The input image.

  • keepdim (bool) – If False (by default), then return the grayscale image with 2 dims, otherwise 3 dims.

Returns

The converted grayscale image.

Return type

ndarray