Export cam_id in shots.geojson

pull/1765/head
Piero Toffanin 2024-06-10 12:56:22 -04:00
rodzic 261de21981
commit 60a886e0a8
1 zmienionych plików z 4 dodań i 3 usunięć

Wyświetl plik

@ -64,11 +64,11 @@ def get_geojson_shots_from_opensfm(reconstruction_file, utm_srs=None, utm_offset
for filename in recon.get('shots', {}):
shot = recon['shots'][filename]
cam = shot.get('camera')
if (not cam in cameras) or (filename in added_shots):
cam_id = shot.get('camera')
if (not cam_id in cameras) or (filename in added_shots):
continue
cam = cameras[cam]
cam = cameras[cam_id]
if pseudo_geocoords is not None:
Rs, T = pseudo_geocoords[:3, :3], pseudo_geocoords[:3, 3]
Rs1 = np.linalg.inv(Rs)
@ -104,6 +104,7 @@ def get_geojson_shots_from_opensfm(reconstruction_file, utm_srs=None, utm_offset
'type': 'Feature',
'properties': {
'filename': filename,
'camera': cam_id,
'focal': cam.get('focal', cam.get('focal_x')), # Focal ratio = focal length (mm) / max(sensor_width, sensor_height) (mm)
'width': cam.get('width', 0),
'height': cam.get('height', 0),