-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
45 lines (31 loc) · 1.08 KB
/
main.py
File metadata and controls
45 lines (31 loc) · 1.08 KB
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
35
36
37
38
39
40
41
42
43
44
45
"""
Author: Aiden Stevenson Bradwell
Date: 2021-11-19
Affiliation: University of Ottawa, Ottawa, Ontario (Student)
Description:
Create two objects, one records frames, one filters the frames and displays them.
Launch both in parallel processing approach
User is able to add or remove filters using an OpenCv button bank
Libraries required:
opencv-python
tkinter
numpy
"""
from video_players import *
from tkinter import *
from cv2 import *
import numpy as np
if __name__ == "__main__":
# Initialization Steps
top = Tk()
l = Label(top, text="").grid(row=0, column=0, columnspan=15)
# Add all currently supported filtering methods
row = 0
# Initialize webcam
camera = cv2.VideoCapture(0)
# Create webcam object, which adds all frames to the filter's frame-queue
video_getter = VideoGetter(camera).start()
video_shower = VideoShower(video_getter.frame_queue, top).start()
top.mainloop()
# If reached, program has been ended. Destroy all windows.
cv2.destroyAllWindows()