| 65 | return (device, cameras) |
| 66 | |
| 67 | def auto_config(device_preset, |
| 68 | key_frame_distance=0.1, |
| 69 | mono=False, |
| 70 | icp=True, |
| 71 | fast=False, |
| 72 | already_rectified=False, |
| 73 | internal=[]): |
| 74 | |
| 75 | config = { |
| 76 | "maxMapSize": 0, |
| 77 | "useSlam": True, |
| 78 | "passthroughColorImages": True, |
| 79 | "keyframeDecisionDistanceThreshold": key_frame_distance, |
| 80 | "icpVoxelSize": min(key_frame_distance, 0.1) |
| 81 | } |
| 82 | parameter_sets = ['wrapper-base'] |
| 83 | |
| 84 | if mono: config['useStereo'] = False |
| 85 | |
| 86 | prefer_icp = icp and not mono |
| 87 | |
| 88 | if not fast: |
| 89 | parameter_sets.append('offline-base') |
| 90 | # remove these to further trade off speed for quality |
| 91 | mid_q = { |
| 92 | 'maxKeypoints': 1000, |
| 93 | 'optimizerMaxIterations': 30 |
| 94 | } |
| 95 | for k, v in mid_q.items(): config[k] = v |
| 96 | |
| 97 | if internal is not None: |
| 98 | for param in internal: |
| 99 | k, _, v = param.partition(':') |
| 100 | config[k] = v |
| 101 | |
| 102 | if device_preset: |
| 103 | parameter_sets.append(device_preset) |
| 104 | |
| 105 | if device_preset == 'k4a': |
| 106 | if prefer_icp: |
| 107 | parameter_sets.extend(['icp']) |
| 108 | if not fast: parameter_sets.append('offline-icp') |
| 109 | elif device_preset == 'realsense': |
| 110 | if prefer_icp: |
| 111 | parameter_sets.extend(['icp', 'realsense-icp']) |
| 112 | if not fast: parameter_sets.append('offline-icp') |
| 113 | elif device_preset == 'oak-d': |
| 114 | config['stereoPointCloudMinDepth'] = 0.5 |
| 115 | config['alreadyRectified'] = already_rectified |
| 116 | elif device_preset is not None and "orbbec" in device_preset: |
| 117 | if prefer_icp: |
| 118 | parameter_sets.extend(['icp']) |
| 119 | if not fast: parameter_sets.append('offline-icp') |
| 120 | |
| 121 | config['parameterSets'] = parameter_sets |
| 122 | return config |
| 123 | |
| 124 | def interpolate_missing_properties(df_source, df_query, k_nearest=3): |