kopia lustrzana https://github.com/OpenDroneMap/ODM
rodzic
8f79e6c05a
commit
5d5fe3a8a7
|
@ -31,6 +31,7 @@ def get_geojson_shots_from_opensfm(reconstruction_file, geocoords_transformation
|
||||||
# Read transform (if available)
|
# Read transform (if available)
|
||||||
if geocoords_transformation_file is not None and utm_srs is not None and os.path.exists(geocoords_transformation_file):
|
if geocoords_transformation_file is not None and utm_srs is not None and os.path.exists(geocoords_transformation_file):
|
||||||
geocoords = np.loadtxt(geocoords_transformation_file, usecols=range(4))
|
geocoords = np.loadtxt(geocoords_transformation_file, usecols=range(4))
|
||||||
|
pseudo = False
|
||||||
elif pseudo_geotiff is not None and os.path.exists(pseudo_geotiff):
|
elif pseudo_geotiff is not None and os.path.exists(pseudo_geotiff):
|
||||||
# pseudogeo transform
|
# pseudogeo transform
|
||||||
utm_srs = get_pseudogeo_utm()
|
utm_srs = get_pseudogeo_utm()
|
||||||
|
@ -47,6 +48,7 @@ def get_geojson_shots_from_opensfm(reconstruction_file, geocoords_transformation
|
||||||
[0, 0, 1, 0],
|
[0, 0, 1, 0],
|
||||||
[0, 0, 0, 1]])
|
[0, 0, 0, 1]])
|
||||||
raster = None
|
raster = None
|
||||||
|
pseudo = True
|
||||||
else:
|
else:
|
||||||
# Can't deal with this
|
# Can't deal with this
|
||||||
return
|
return
|
||||||
|
@ -83,6 +85,8 @@ def get_geojson_shots_from_opensfm(reconstruction_file, geocoords_transformation
|
||||||
rotation_matrix = get_rotation_matrix(np.array(shot['rotation']))
|
rotation_matrix = get_rotation_matrix(np.array(shot['rotation']))
|
||||||
rotation = matrix_to_rotation(np.dot(rotation_matrix, Rs1))
|
rotation = matrix_to_rotation(np.dot(rotation_matrix, Rs1))
|
||||||
|
|
||||||
|
translation = origin if pseudo else utm_coords
|
||||||
|
|
||||||
feats.append({
|
feats.append({
|
||||||
'type': 'Feature',
|
'type': 'Feature',
|
||||||
'properties': {
|
'properties': {
|
||||||
|
@ -90,8 +94,8 @@ def get_geojson_shots_from_opensfm(reconstruction_file, geocoords_transformation
|
||||||
'focal': cam.get('focal', cam.get('focal_x')), # Focal ratio = focal length (mm) / max(sensor_width, sensor_height) (mm)
|
'focal': cam.get('focal', cam.get('focal_x')), # Focal ratio = focal length (mm) / max(sensor_width, sensor_height) (mm)
|
||||||
'width': cam.get('width', 0),
|
'width': cam.get('width', 0),
|
||||||
'height': cam.get('height', 0),
|
'height': cam.get('height', 0),
|
||||||
'translation': shot['translation'],
|
'translation': list(translation),
|
||||||
'rotation': [rotation[0], rotation[1], rotation[2]]
|
'rotation': list(rotation)
|
||||||
},
|
},
|
||||||
'geometry':{
|
'geometry':{
|
||||||
'type': 'Point',
|
'type': 'Point',
|
||||||
|
|
Ładowanie…
Reference in New Issue