加入三个窗口显示rgb通道
This commit is contained in:
+10
-5
@@ -7,19 +7,24 @@ img = cv.imread("opencv_logo.png",cv.IMREAD_UNCHANGED)
|
||||
height,width,channel=img.shape
|
||||
|
||||
# show infos
|
||||
print(img.shape)
|
||||
print("height=\t",height)
|
||||
print("width=\t",width)
|
||||
print("channel=\t",height)
|
||||
print("channel=\t",channel)
|
||||
|
||||
# split channels
|
||||
blue,green,red=cv.split(img)
|
||||
|
||||
# show channels
|
||||
## red channel
|
||||
#cv.imshow("channel", red)
|
||||
cv.namedWindow("red channel")
|
||||
cv.imshow("red channel", red)
|
||||
## green channel
|
||||
cv.imshow("channel", green)
|
||||
cv.namedWindow("green channel")
|
||||
cv.imshow("green channel", green)
|
||||
## blue channel
|
||||
#cv.imshow("channel", blue)
|
||||
cv.namedWindow("blue channel")
|
||||
cv.imshow("blue channel", blue)
|
||||
|
||||
cv.waitKey(0)
|
||||
cv.destroyWindow("channel")
|
||||
cv.destroyAllWindows()
|
||||
Reference in New Issue
Block a user