Camera factories¶
Factories for creating camera models from parameter files and dictionaries.
- class orthority.factory.Cameras(**kwargs)¶
Bases:
ABCBase camera factory class.
- abstractmethod get(filename)¶
Return a camera object for the given image filename.
- class orthority.factory.FrameCameras(int_param, ext_param, io_kwargs=None, cam_kwargs=None)¶
Bases:
CamerasFrame camera factory.
- Parameters:
int_param (str | PathLike | OpenFile | IO[str] | dict[str, dict]) – Interior parameter file or dictionary. If a file, can be a path or URI string, an
OpenFileobject or a file object, opened in text mode ('rt').ext_param (str | PathLike | OpenFile | IO[str] | dict[str, dict]) – Exterior parameter file or dictionary. If a file, can be a path or URI string, an
OpenFileobject or a file object, opened in text mode ('rt').io_kwargs (dict) – Optional dictionary of keyword arguments for the
FrameReadersub-class corresponding to the exterior parameter file format. Should excludeext_paramorint_paramfile names, which are passed internally. Ifext_paramis a dictionary, these arguments are not passed to theFrameReadersub-class, butFrameCameras.crsis set with the value of acrsargument.cam_kwargs (dict) – Optional dictionary of keyword arguments for the
FrameCameraclass. Should exclude interior and exterior parameters which are passed internally.
- classmethod from_images(files, io_kwargs=None, cam_kwargs=None)¶
Create frame camera factory from image file(s) with EXIF / XMP tags.
- Parameters:
files (Sequence[str | PathLike | OpenFile | DatasetReader]) – Image file(s) to read as a list of paths or URI strings,
OpenFileobjects in binary mode ('rb'), or dataset readers.io_kwargs (dict) – Optional dictionary of keyword arguments for the
ExifReaderclass. Should excludefileswhich is passed internally.cam_kwargs (dict) – Optional dictionary of keyword arguments for the
FrameCameraclass. Should exclude interior and exterior parameters which are passed internally.
- class orthority.factory.RpcCameras(rpc_param, cam_kwargs=None)¶
Bases:
CamerasRPC camera factory.
- Parameters:
rpc_param (str | PathLike | OpenFile | IO[str] | dict[str, dict]) – Orthority RPC parameter file or dictionary. If a file, can be a path or URI string, an
OpenFileobject or a file object, opened in text mode ('rt').cam_kwargs (dict) – Optional dictionary of keyword arguments for the
RpcCameraclass. Should excludeim_sizeandrpcwhich are passed internally.
- classmethod from_images(files, io_kwargs=None, cam_kwargs=None)¶
Create RPC camera factory from image file(s) with RPC tags / sidecar file(s).
- Parameters:
files (Sequence[str | PathLike | OpenFile | DatasetReader]) – Image file(s) to read as a list of paths or URI strings,
OpenFileobjects in binary mode ('rb'), or dataset readers.io_kwargs (dict) – Optional dictionary of additional arguments for
read_im_rpc_param. Should excludefileswhich is passed internally.cam_kwargs (dict) – Optional dictionary of keyword arguments for the
RpcCameraclass. Should excludeim_sizeandrpcwhich are passed internally.
- refine(gcps, io_kwargs=None, fit_kwargs=None)¶
Refine RPC models with GCPs.
- Parameters:
gcps (str | PathLike | OpenFile | IO[str] | Sequence[str | PathLike | OpenFile | DatasetReader] | dict[str, list[dict]]) –
GCPs as one of:
Orthority GCP file as a path or URI string, an
OpenFileobject or file object, opened in text mode ('rt').Image file(s) with GCP tags as a list of paths or URI strings,
OpenFileobjects in binary mode ('rb'), or dataset readers.GCP dictionary.
io_kwargs (dict) – Optional dictionary of keyword arguments for
read_im_gcpsifgcpsis a list of image file(s). Should excludefileswhich is passed internally.fit_kwargs (dict) – Optional dictionary of keyword arguments for
refine_rpc(). Should excluderpcandgcps, which are passed internally.
- get(filename)¶
Return a camera object for the given image filename.
- write_param(out_dir, overwrite=False)¶
Write camera parameters to Orthority format file(s).
When the models have been refined, the refined models are written, together with the GCPs.