Problem in OpenCv

Please tell the difference between these 2 commands – cv2.IMREAD_GRAYSCALE and cv2.COLOR_BGR2GRAY as both these commands were used by sir to convert image into gray image.

Hey @abhaygarg2001, there is not much of a difference between these two commands.

cv2.IMREAD_GRAYSCALE: It specifies to load an image in grayscale mode. Alternatively, we can pass integer value 0 for this flag.

whereas

cv2.COLOR_BGR2GRAY : It is used to convert the colour space of an already loaded image from BGR to Grayscale. 

If you want to know what minor difference is there between the two, then you can have a look at this link.

Hope this helps you understand better :slight_smile:
Happy Learning :slight_smile: