解析 KITTI Odometry calib.txt → {key: (3,4) float32},key ∈ {P0,P1,P2,P3,Tr}。
(path: Path)
| 1033 | |
| 1034 | |
| 1035 | def _parse_kitti_calib(path: Path) -> dict: |
| 1036 | """解析 KITTI Odometry calib.txt → {key: (3,4) float32},key ∈ {P0,P1,P2,P3,Tr}。""" |
| 1037 | out = {} |
| 1038 | with open(path) as f: |
| 1039 | for line in f: |
| 1040 | line = line.strip() |
| 1041 | if not line: |
| 1042 | continue |
| 1043 | key, _, vals = line.partition(':') |
| 1044 | parts = vals.split() |
| 1045 | if len(parts) < 12: |
| 1046 | continue |
| 1047 | out[key.strip()] = np.array([float(x) for x in parts[:12]], dtype=np.float32).reshape(3, 4) |
| 1048 | return out |
| 1049 | |
| 1050 | |
| 1051 | def _parse_kitti_poses(path: Path) -> np.ndarray: |
no outgoing calls
no test coverage detected