mmcv.image.rgb2gray¶
- mmcv.image.rgb2gray(img: numpy.ndarray, keepdim: bool = False) → numpy.ndarray[source]¶
Convert a RGB 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