Skip to content

Commit 515cdc1

Browse files
committed
overwrite camera config
1 parent 5751ade commit 515cdc1

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
'height': 700 # if not full screen
1313
},
1414
'video': {
15-
'camera': 'BUILTIN', # either 'USB' or 'BUILTIN'
15+
'camera': 'USB', # either 'USB' or 'BUILTIN'
1616
'max_input_width': 640, # high res: 1920, low res: 640
1717
'max_input_height': 480, # high res: 1080, low res: 480
1818
'raw_display_width': 250,

planvec/gui/video_stream.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,18 @@ def __init__(self, frame_buffer: FrameBuffer, video_config, parent=None):
2626
self.stopped = False
2727

2828
def run(self) -> None:
29-
print(self.video_config.camera)
30-
capture = cv2.VideoCapture(CAM_MAP[self.video_config.camera])
29+
# print(self.video_config.camera)
30+
print("Video config is overwritten hardcoded.")
31+
# TODO: Undo this ugly hack.
32+
#capture = cv2.VideoCapture(CAM_MAP[self.video_config.camera])
33+
capture = cv2.VideoCapture(-1)
34+
"""
3135
if not capture.isOpened():
3236
capture = cv2.VideoCapture(abs(1 - CAM_MAP[self.video_config.camera]))
3337
warnings.warn(f'Needed to switch camera choice!')
3438
if not capture.isOpened():
3539
raise RuntimeError(f'Couldn\'t connect to camera! Tried all of {list(CAM_MAP.keys())}')
40+
"""
3641
capture.set(cv2.CAP_PROP_FRAME_WIDTH, self.video_config.max_input_width)
3742
capture.set(cv2.CAP_PROP_FRAME_HEIGHT, self.video_config.max_input_height)
3843
while True:

0 commit comments

Comments
 (0)