重命名

This commit is contained in:
2024-09-10 11:22:07 +08:00
parent e39389cf7a
commit 0fccff2da8
+30
View File
@@ -0,0 +1,30 @@
import cv2 as cv
# read image
img = cv.imread("opencv_logo.png",cv.IMREAD_UNCHANGED)
# get height and width, channel of img
height,width,channel=img.shape
# show infos
print(img.shape)
print("height=\t",height)
print("width=\t",width)
print("channel=\t",channel)
# split channels
blue,green,red=cv.split(img)
# show channels
## red channel
cv.namedWindow("red channel")
cv.imshow("red channel", red)
## green channel
cv.namedWindow("green channel")
cv.imshow("green channel", green)
## blue channel
cv.namedWindow("blue channel")
cv.imshow("blue channel", blue)
cv.waitKey(0)
cv.destroyAllWindows()