Examples of image channel separation and merging in Python

Time:2020-9-24

I will not say much nonsense, directly on the code!

import cv2

img = cv2.imread("1.jpg")

b. G, r = CV2. Split (IMG) ා separation function
Merged = CV2. Merge ([b, G, R]) ා merge function

cv2.imshow('image',img)
cv2.imshow("Blue 1", b)
cv2.imshow("Green 1", g)
cv2.imshow("Red 1", r)
cv2.imshow("merged 1", merged)
cv2.waitKey(0)
cv2.destroyAllWindows()

The above example of image channel separation and merging in Python is the whole content shared by Xiaobian. I hope it can give you a reference, and I hope you can support developeppaer more.

Recommended Today

Understand mybatis step by step through the project

Reprint please be sure to indicate the source, original is not easy! Related articles:Understand mybatis < 1 > step by step through the project All code address of the project:Github-Mybatis Mybatis solves the problem of JDBC programming 1. The frequent creation and release of database links results in the waste of system resources, which affects […]