MCPcopy
hub / github.com/yosinski/deep-visualization-toolbox / bind_camera

Method bind_camera

input_fetcher.py:54–67  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

52 self.static_file_idx_increment = 0
53
54 def bind_camera(self):
55 # Due to OpenCV limitations, this should be called from the main thread
56 print 'InputImageFetcher: bind_camera starting'
57 if self.no_cam_present:
58 print 'InputImageFetcher: skipping camera bind (device: None)'
59 else:
60 self.bound_cap_device = cv2.VideoCapture(self.capture_device)
61 if self.bound_cap_device.isOpened():
62 print 'InputImageFetcher: capture device %s is open' % self.capture_device
63 else:
64 print '\n\nWARNING: InputImageFetcher: capture device %s failed to open! Camera will not be available!\n\n' % self.capture_device
65 self.bound_cap_device = None
66 self.no_cam_present = True
67 print 'InputImageFetcher: bind_camera finished'
68
69 def free_camera(self):
70 # Due to OpenCV limitations, this should be called from the main thread

Callers 1

run_loopMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected