cv3.color_spaces.rgb2gray

cv3.color_spaces.rgb2gray(img)[source]

Convert image from RGB to grayscale.

Parameters:

img (numpy.ndarray) – Input image in RGB format.

Returns:

Grayscale image.

Return type:

numpy.ndarray