cvcvtColor method

cv2.cvtColor() method is used to convert an image from one color space to another. There are more than 150 color-space conversion methods available in OpenCV.

Syntax: cv2.cvtColor(src, code[, dst[, dstCn]])

Parameters:

  • src: Image
  • code: It is the color space conversion code.
  • dst: (optional), It is the output image of the same size and depth as src image.
  • dstCn: (optional),It is the number of channels in the destination image

Return Value: It returns an image.

Image used for demonstration:

 

Removing Black Background and Make Transparent using Python OpenCV

In this article, we will discuss how to remove the black background and make it transparent in Python OpenCV.

Similar Reads

cv2.cvtColor method

cv2.cvtColor() method is used to convert an image from one color space to another. There are more than 150 color-space conversion methods available in OpenCV....

Stepwise Implementation:

Step 1: First of all, import the library OpenCV....

Contact Us