| 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 |