1.图像,视频的加载,保存

import cv2 as cv

def video_demo():
capture=cv.VideoCapture()
while(True):
ret,frame=capture.read()
frame=cv.flip(frame,1) #图像翻转
cv.imshow('video',frame)
c=cv.waitKey(50)
if c==27:
break


def get_image_info(image):
print(type(image))
print(image.shape)
print(image.size)
print(image.dtype)
print(image)


src=cv.imread('D:/pycharm/pycharmproject/test.jpg')#src是numpy.ndarray类型
cv.imshow('src',src)
get_image_info(src)
# video_demo()
cv.waitKey()
cv.destroyAllWindows()

猜你喜欢

转载自www.cnblogs.com/liutianrui1/p/10000536.html