Parsing
parsing
¶
Functions¶
make_4x4_transform(rotation_str, translation_str, scale_str='1')
¶
Convenience function to make a 4x4 matrix from the string format used by Metashape
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
rotation_str
|
str
|
Row major with 9 entries |
required |
translation_str
|
str
|
3 entries |
required |
scale_str
|
str
|
single value. Defaults to "1". |
'1'
|
Returns:
| Type | Description |
|---|---|
|
np.ndarray: (4, 4) A homogenous transform mapping from cam to world |
Source code in geograypher/utils/parsing.py
parse_metashape_mesh_metadata(mesh_metadata_file)
¶
Parse the metadata file which is produced by Metashape when exporting a mesh to determine the coordinate reference frame and origin shift to use when interpreting the mesh.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mesh_metadata_file
|
Union[str, Path]
|
Path to the metadata XML file. |
required |
Returns:
| Type | Description |
|---|---|
Union[CRS, None]
|
Union[pyproj.CRS, None]: The CRS to interpret the vertices (after the shift). If not present, None is returned. |
Union[ndarray, None]
|
Union[np.ndarray, None]: The shift to be added to the mesh vertices. If not present, None is returned. |