def load_rgb(self, **kwargs): """Load RGB stereo images from file. Setting imformat='cv2' will convert the images to uint8 and BGR for easy use with OpenCV. """ print('Loading color images from ' + self.sequence + '...') imL_path = os.path.join(self.base_path, 'image_02', self.sequence, '*.png') imR_path = os.path.join(self.base_path, 'image_03', self.sequence, '*.png') imL_files = sorted(glob.glob(imL_path)) imR_files = sorted(glob.glob(imR_path)) # Subselect the chosen range of frames, if any if self.frame_range: imL_files = [imL_files[i] for i in self.frame_range] imR_files = [imR_files[i] for i in self.frame_range] print('Found ' + str(len(imL_files)) + ' image pairs...') self.rgb = utils.load_stereo_pairs(imL_files, imR_files, **kwargs) self.img_shape = self.rgb[0].left.shape print('done.')
def load_gray(self, **kwargs): """Load monochrome stereo images from file. Setting imformat='cv2' will convert the images to uint8 for easy use with OpenCV. """ print('Loading monochrome images from sequence ' + self.sequence + '...') imL_path = os.path.join(self.sequence_path, 'image_0', '*.png') imR_path = os.path.join(self.sequence_path, 'image_1', '*.png') imL_files = sorted(glob.glob(imL_path)) imR_files = sorted(glob.glob(imR_path)) # Subselect the chosen range of frames, if any if self.frame_range: imL_files = [imL_files[i] for i in self.frame_range] imR_files = [imR_files[i] for i in self.frame_range] print('Found ' + str(len(imL_files)) + ' image pairs...') self.gray = utils.load_stereo_pairs(imL_files, imR_files, **kwargs) print('done.')
def load_rgb(self, **kwargs): """Load RGB stereo images from file. Setting imformat='cv2' will convert the images to uint8 and BGR for easy use with OpenCV. """ print('Loading color images from ' + self.drive + '...') imL_path = os.path.join(self.data_path, 'image_02', 'data', '*.png') imR_path = os.path.join(self.data_path, 'image_03', 'data', '*.png') imL_files = sorted(glob.glob(imL_path)) imR_files = sorted(glob.glob(imR_path)) # Subselect the chosen range of frames, if any if self.frame_range: imL_files = [imL_files[i] for i in self.frame_range] imR_files = [imR_files[i] for i in self.frame_range] print('Found ' + str(len(imL_files)) + ' image pairs...') self.rgb = utils.load_stereo_pairs(imL_files, imR_files, **kwargs) print('done.')