mmcv.image.rgb2gray¶
- mmcv.image.rgb2gray(img: numpy.ndarray, keepdim: bool = False) → numpy.ndarray[源代码]¶
Convert a RGB image to grayscale image.
- 参数
img (ndarray) – The input image.
keepdim (bool) – If False (by default), then return the grayscale image with 2 dims, otherwise 3 dims.
- 返回
The converted grayscale image.
- 返回类型
ndarray