forked from rsarwar87/pyReflectorCollimator
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.py
executable file
·33 lines (23 loc) · 855 Bytes
/
main.py
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
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import dearpygui.dearpygui as dpg
from pyCameraController import CameraController
from pyCameraWindow import CameraWindow
if __name__ == "__main__":
#If not seeing any camera output, change the 1 below to 0, 2, 3, etc.
#This could probably be automated or a user-select added.
cc = CameraController(1)
dpg.create_context()
dpg.create_viewport(title='PyReflectorCollimator', width=1800, height=800)
dpg.setup_dearpygui()
cc.create_window()
cw = CameraWindow(cc)
print ("Initialized")
dpg.show_metrics()
dpg.show_viewport()
while dpg.is_dearpygui_running():
cw.update_frame()
dpg.render_dearpygui_frame()
cc.vid.release()
#cv.destroyAllWindows() # when using upen cv window "imshow" call this also
dpg.destroy_context()