#if os.path.exists(args.disp_path) is False: # raise OSError('Path for disparity image: {0} does not exist'.format(args.disp_path)) #if os.path.exists(args.config_path) is False: # raise OSError('Path for configuration (.xml) file: {0} does not exist'.format(args.config_path)) max_ps = int(args.max_ps) layers = int(args.layers) patch_shape = int(args.patch_shape) min_ps = max_ps - layers #pdb.set_trace() print("\n******************\n") print("Loading the scene: colored image and disparity..") print("\ncolored image: found at {0}..".format(args.colorimage_path)) print("disparity map: found at {0}..".format(args.disp_path)) lenses = xmlio.load_with_disp(args.colorimage_path, args.disp_path, args.config_path) lens_imgs = dict() disp_imgs = dict() min_d = lenses[0, 0].col_img.shape[0] * 2 # just a high number max_d = 0 for key in lenses: lens_imgs[key] = lenses[key].col_img disp_imgs[key] = lenses[key].disp_img if np.min(np.asarray(disp_imgs[key])) < min_d: min_d = np.min(np.asarray(disp_imgs[key])) if np.max(np.asarray(disp_imgs[key])) > max_d: max_d = np.max(np.asarray(disp_imgs[key])) isReal = True
args = parser.parse_args() if os.path.exists(args.output_path) is False: raise OSError('Path {0} does not exist'.format(args.output_path)) if os.path.exists(args.disp_path) is False: raise OSError('Path for disparity image: {0} does not exist'.format( args.output_path)) if os.path.exists(args.config_path) is False: raise OSError( 'Path for configuration (.xml) file: {0} does not exist'.format( args.output_path)) max_ps = int(args.max_ps) layers = int(args.layers) min_ps = max_ps - layers lenses = xmlio.load_with_disp(args.input_filename[0], args.disp_path, args.config_path) lens_imgs = dict() disp_imgs = dict() min_d = lenses[0, 0].col_img.shape[0] * 2 # just a high number max_d = 0 for key in lenses: lens_imgs[key] = lenses[key].col_img disp_imgs[key] = lenses[key].disp_img if np.min(np.asarray(disp_imgs[key])) < min_d: min_d = np.min(np.asarray(disp_imgs[key])) if np.max(np.asarray(disp_imgs[key])) > max_d: max_d = np.max(np.asarray(disp_imgs[key])) isReal = True