ImageBatch#
Methods
This are most important functions to be used for image classes
|
Calculate projection of 3d points into image. |
|
Map center point of image to 3d |
|
Map footprint of images of batch to 3d |
|
Add images to the batch. |
- class weitsicht.ImageBatch(images: dict[str, ImageBase], mapper: MappingBase | None = None)[source]#
Container for running operations on a set of named images.
- Parameters:
images (dict[str, ImageBase])
mapper (MappingBase | None)
- __init__(images: dict[str, ImageBase], mapper: MappingBase | None = None)[source]#
Initialize an image batch.
- Parameters:
images (dict[str, ImageBase]) – Dictionary of images.
mapper (MappingBase | None) – Optional default mapper assigned to images without a mapper, defaults to
None.
- add_images(images: dict[str, ImageBase])[source]#
Add images to the batch.
- Parameters:
images (dict[str, ImageBase]) – Images to add.
- Raises:
KeyError – If any keys already exist in the batch.
- index(indices: int) ImageBase[source]#
- index(indices: list[int] | tuple[int]) dict[str, ImageBase]
index get images by indices
Get the images by using indices. Will return the image at the indices of the image dict from ImageBatch.
- map_center_point(mapper: MappingBase | None = None, transformer: CoordinateTransformer | None = None) dict[str, MappingResultSuccess | ResultFailure[Issue]][source]#
Map center point of image to 3d
- Parameters:
mapper (MappingBase | None) – Specify Mapper to be used, can be different to the one assigned in the class
transformer (CoordinateTransformer | None) – A CoordinateTransfoer object which can be passed instead using crs_s
- Returns:
MappingResult for all images
- Raises:
ValueError – Image Batch is empty
NotGeoreferencedError – If an image is not geo-referenced
MapperMissingError – If no mapper is available
CRSInputError – If CRS/transformer input is invalid
CoordinateTransformationError – If coordinate transformation fails
MappingError – If mapping fails
- Return type:
dict[str, MappingResultSuccess | ResultFailure[Issue]]
- map_footprint(points_per_edge: int = 0, mapper: MappingBase | None = None, transformer: CoordinateTransformer | None = None) dict[str, MappingResultSuccess | ResultFailure[Issue]][source]#
Map footprint of images of batch to 3d
- Parameters:
points_per_edge (int) – The number of points which should be inserted between corners. 0: only corner points are mapped
mapper (MappingBase | None) – Optional specify another Mapper to be used, can be different to the one assigned in the image class
transformer (CoordinateTransformer | None) – A CoordinateTransfoer object which can be passed instead using crs_s
- Returns:
MappingResult for all images
- Raises:
ValueError – Image Batch is empty
NotGeoreferencedError – If an image is not geo-referenced
MapperMissingError – If no mapper is available
CRSInputError – If CRS/transformer input is invalid
CoordinateTransformationError – If coordinate transformation fails
MappingError – If mapping fails
- Return type:
dict[str, MappingResultSuccess | ResultFailure[Issue]]
- project(coordinates: ndarray[tuple[Any, ...], dtype[_ScalarT]], crs_s: CRS | None = None, transformer: CoordinateTransformer | None = None, only_valid: bool = False) dict[str, ProjectionResultSuccess | ResultFailure[Issue]] | None[source]#
Calculate projection of 3d points into image. If points was outsize image size and to_distortion is true the undistorted projection will be returned
- Parameters:
coordinates (ArrayNx3) – Array of (nx3) with the point positions
crs_s (CRS | None) – The coordinate system of the input coordinates
transformer (CoordinateTransformer | None) – A CoordinateTransfoer object which can be passed instead using crs_s
only_valid (bool) – If true only return images with valid projections.
- Returns:
dict[ImageName, ProjectionResult] or None if for filtered (only_valid) no projections are valid
- Raises:
ValueError – If the image batch is empty.
CRSInputError – If both
crs_sandtransformerare provided.NotGeoreferencedError – If an image is not geo-referenced.
MapperMissingError – If a required mapper is missing.
CoordinateTransformationError – If coordinate transformation fails.
- Return type:
dict[str, ProjectionResultSuccess | ResultFailure[Issue]] | None