-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvideo_example.py
More file actions
34 lines (27 loc) · 868 Bytes
/
video_example.py
File metadata and controls
34 lines (27 loc) · 868 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import numpy
from matplotlib import pyplot
from random import seed, randint
import cv2
from models.image import Image
def show_video():
'''
#video = cv2.VideoCapture(0, cv2.CAP_DSHOW) #a This is used to capture the webcam video
video = cv2.VideoCapture('./videos/example.avi')
rgb_image = Image(title="Original Video")
mask_image = Image(title="Mask Video")
running = True
while running:
running, frame = video.read()
rgb_image.set_frame(frame)
light_color = numpy.array([120, 68, 32])
dark_color = numpy.array([230, 164, 129])
mask_image.set_frame(frame)
mask_image.add_mask(light_color, dark_color)
mask_image.apply_mask()
mask_image.update_window()
pyplot.pause(1)
pyplot.show(block=False)
'''
pass
if __name__ == '__main__':
show_video()