Parameter IO¶
Parameter file IO and conversions.
- orthority.param_io.read_oty_int_param(file)¶
Read interior parameters for one or more cameras from an Orthority interior parameter file.
- orthority.param_io.read_osfm_int_param(file)¶
Read interior parameters for one or more cameras, from an OpenDroneMap
cameras.jsonor OpenSfMreconstruction.jsonfile.See the format documentation for supported camera models.
- orthority.param_io.read_exif_int_param(file)¶
Read interior parameters for a camera from an image file with EXIF / XMP tags.
See the format documentation for required tags.
- orthority.param_io.read_im_rpc_param(files, progress=False)¶
Read RPC camera parameters from image file(s) with RPC tags / sidecar file(s).
- Parameters:
files (Sequence[str | PathLike | OpenFile | DatasetReader]) – File(s) to read as a list of paths or URI strings,
OpenFileobjects in binary mode ('rb'), or dataset readers.progress (bool | dict) – Whether to display a progress bar monitoring the portion of files read. Can be set to a dictionary of arguments for a custom tqdm bar.
- Return type:
- orthority.param_io.read_oty_rpc_param(file)¶
Read RPC parameters for one or more cameras from an Orthority RPC file.
- orthority.param_io.read_im_gcps(files, progress=False)¶
Read GCPs from tags in image file(s).
- Parameters:
files (Sequence[str | PathLike | OpenFile | DatasetReader]) – File(s) to read as a list of paths or URI strings,
OpenFileobjects in binary mode ('rb'), or dataset readers.Whether to display a progress bar monitoring the portion of files read. Can be set to a dictionary of arguments for a custom tqdm bar.
- Return type:
- orthority.param_io.read_oty_gcps(file)¶
Read GCPs for one or more images from an Orthority GCP file.
- orthority.param_io.write_int_param(file, int_param_dict, overwrite=False)¶
Write interior parameters to an Orthority interior parameter file.
- Parameters:
- Return type:
None
- orthority.param_io.write_ext_param(file, ext_param_dict, crs, overwrite=False)¶
Write exterior parameters to an Orthority exterior parameter file.
- Parameters:
file (str | PathLike | OpenFile | IO[str]) – File to write. Can be a path or URI string, an
OpenFileobject or a file object, opened in text mode ('wt').ext_param_dict (dict[str, dict[str, Any]]) – Exterior parameters to write.
crs (str | CRS) – CRS of the world coordinate system as an EPSG, WKT or proj4 string; or
CRSobject.overwrite (bool) – Whether to overwrite the file if it exists.
- Return type:
None
- orthority.param_io.write_rpc_param(file, rpc_param_dict, overwrite=False)¶
Write RPC parameters to an Orthority RPC parameter file.
- Parameters:
- Return type:
None
- orthority.param_io.write_gcps(file, gcp_dict, overwrite=False)¶
Write GCPs to an Orthority GCP file.
- class orthority.param_io.FrameReader(crs=None, lla_crs=CRS.from_epsg(4979))¶
Bases:
ABCBase frame camera parameter reader.
- Parameters:
- class orthority.param_io.CsvReader(file, crs=None, lla_crs=CRS.from_epsg(4979), fieldnames=None, dialect=None, radians=False, **kwargs)¶
Bases:
FrameReaderExterior parameter reader for a CSV file.
Reads tabular data from a CSV file with a row per source image and column fields for image file name, camera position, orientation and ID.
See the CSV documentation for details on supported fields and formats.
- Parameters:
file (str | PathLike | OpenFile | IO[str]) – File to read. Can be a path or URI string, an
OpenFileobject or a file object, opened in text mode ('rt').crs (str | CRS) – CRS of the world coordinate system as an EPSG, WKT or proj4 string; or
CRSobject. If set toNone(the default), and the file contains (x,y,z) world coordinate positions, a CRS can be provided via a.prjsidecar file. If set toNone, and the file contains (latitude,longitude,altitude) and (roll,pitch,yaw) fields, a UTM CRS will be auto-determined. If the file contains (latitude,longitude,altitude) or (roll,pitch,yaw) fields (but not both),crsshould be supplied.lla_crs (str | CRS) – Geographic CRS associated with any (
latitude,longitude,altitude) position and/or (roll,pitch,yaw) values in the file (as an EPSG, WKT or proj4 string; orCRSobject).fieldnames (Sequence[str]) – List of names specifying the CSV fields. If set to
None(the default), names will be read from the file header if it exists. Iffieldnamesis supplied, any existing file header is ignored. See the CSV documentation for recognised and required field names.dialect (Dialect) –
Dialectobject specifying the CSV delimiter, quote character etc. If set toNone(the default), this is auto-detected from the file.radians (bool) – Whether orientation angles are in radians (
True), or degrees (False).
- class orthority.param_io.OsfmReader(file, crs=None, lla_crs=CRS.from_epsg(4326), **kwargs)¶
Bases:
FrameReaderInterior and exterior parameter reader for an OpenSfM
reconstruction.jsonfile.See the format documentation for supported camera models.
- Parameters:
file (str | PathLike | OpenFile | IO[str]) – File to read. Can be a path or URI string, an
OpenFileobject or a file object, opened in text mode ('rt').crs (str | CRS) – CRS of the world coordinate system as an EPSG, WKT or proj4 string; or
CRSobject. If set toNone(the default), a UTM CRS will be auto-determined.lla_crs (str | CRS) – CRS of the
reference_llavalue in thereconstruction.jsonfile as an EPSG, WKT or proj4 string; orCRSobject.
- class orthority.param_io.ExifReader(files, crs=None, lla_crs=CRS.from_epsg(4979), progress=False, **kwargs)¶
Bases:
FrameReaderInterior and exterior parameter reader for image file(s) with EXIF / XMP tags.
See the format documentation for required tags.
- Parameters:
files (Sequence[str | PathLike | OpenFile | rio.DatasetReader]) – File(s) to read as a list of paths or URI strings,
OpenFileobjects in binary mode ('rb'), or dataset readers.crs (str | CRS) – CRS of the world coordinate system as an EPSG, WKT or proj4 string; or
CRSobject. If set toNone(the default), a UTM CRS will be auto-determined.lla_crs (str | CRS) – CRS of geographic camera coordinates in the EXIF / XMP tags as an EPSG, WKT or proj4 string; or
CRSobject.Whether to display a progress bar monitoring the portion of files read. Can be set to a dictionary of arguments for a custom tqdm bar.
- class orthority.param_io.OtyReader(file, **kwargs)¶
Bases:
FrameReaderExterior parameter reader for an Orthority exterior parameter file.