mmcv.image.rgb2gray¶
- mmcv.image.rgb2gray(img: ndarray, keepdim: bool = False) 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