9月10日课上题
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
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("height=\t",height)
|
||||
print("width=\t",width)
|
||||
print("channel=\t",height)
|
||||
|
||||
# split channels
|
||||
blue,green,red=cv.split(img)
|
||||
|
||||
# show channels
|
||||
## red channel
|
||||
#cv.imshow("channel", red)
|
||||
## green channel
|
||||
cv.imshow("channel", green)
|
||||
## blue channel
|
||||
#cv.imshow("channel", blue)
|
||||
cv.waitKey(0)
|
||||
cv.destroyWindow("channel")
|
||||
Reference in New Issue
Block a user