import cv2 as cv
def get_video():
capture=cv.VideoCapture(video_path)
while(True):
rect, frame = capture.read()
cv.imshow('video',frame)
c=cv.waitKey(50)
if c == 27:
break
def get_image_info(src):
print(src.size)
print(src.shape)
print(type(src))
print(src.dtype)
def write_image(src):
gray=cv.cvtColor(src,cv.COLOR_BGR2GRAY)
cv.imwrite('../image/gray.png',gray)
path="../image/person.jpg"
video_path="../image/2.mp4"
src=cv.imread(path)
cv.namedWindow("baby",cv.WINDOW_AUTOSIZE)
cv.namedWindow("video",cv.WINDOW_AUTOSIZE)
cv.imshow("baby",src)
write_image(src)
get_video()
get_image_info(src)
cv.waitKey(0)
cv.destroyAllWindows()
4665600
(1080, 1440, 3)
<class 'numpy.ndarray'>
uint8