python opencv: color space

RGB color space

Common color space

Color space conversion

cv2.cvtColor(image, 转换选项)

Two common color conversion

HSV and RGB
YUV and RGB

inRange method

Function parameters:
first parameter: picture is
the second argument: lower_red refers to a value lower than the lower_red image, the image value becomes 0.
The third parameter: upper_red refers to a value higher than this image upper_red The image value becomes 0

Separating the combined channel API

Channel Split:

b, g, r = cv2.split(img)

Channel Merge:

src = cv2.merge([b, g, r])

Guess you like

Origin www.cnblogs.com/wbyixx/p/12236931.html