1. 程式人生 > >1.影象,視訊的載入,儲存

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()