paidiverpy.open_layer.utils#
Open Layer utils module.
Functions#
|
Open an image file. |
|
Open an image file. |
|
Correct the image dimensions and format. |
|
Pad the image to the target height and width. |
|
Load a raw image file. |
|
Load a raw image file using the open function. |
|
Decode 8-bit per channel image data. |
|
Decode 16-bit packed RGB into 8-bit per channel RGB based on layout. |
|
Extract EXIF data from a single image file. |
Module Contents#
- paidiverpy.open_layer.utils.open_image_remote(img_path: str, image_type: str, image_open_args: dict[str, Any], **kwargs: dict[str, Any]) tuple[numpy.ndarray[Any, Any] | dask.array.core.Array, dict[str, Any], str][source]#
Open an image file.
- Parameters:
- Raises:
ValueError – Failed to open the image
- Returns:
The image data, the EXIF data, and the filename
- Return type:
tuple[np.ndarray[Any, Any] | da.core.Array, dict[str, Any], str]
- paidiverpy.open_layer.utils.open_image_local(img_path: str, image_type: str, image_open_args: dict[str, Any], **_kwargs: dict[str, Any]) tuple[numpy.ndarray[Any, Any] | dask.array.core.Array, dict[str, Any], str][source]#
Open an image file.
- Parameters:
- Raises:
ValueError – Failed to open the image
- Returns:
The image data, the EXIF data, and the filename
- Return type:
- paidiverpy.open_layer.utils.correct_image_dims_and_format(img: numpy.ndarray[Any, Any] | dask.array.core.Array, image_type: str | None = None) numpy.ndarray[Any, Any] | dask.array.core.Array[source]#
Correct the image dimensions and format.
- Parameters:
img (np.ndarray[Any, Any] | da.core.Array) – The image data
image_type (str | None) – The image type
- Returns:
The corrected image data
- Return type:
np.ndarray[Any, Any] | da.core.Array
- paidiverpy.open_layer.utils.pad_image(img: numpy.ndarray[Any, Any] | dask.array.core.Array, target_height: int, target_width: int) numpy.ndarray[Any, Any] | dask.array.core.Array[source]#
Pad the image to the target height and width.
- paidiverpy.open_layer.utils.load_raw_image(img_path: str | io.BytesIO, image_type: str, image_open_args: dict[str, Any], remote: bool = False) numpy.ndarray[Any, Any] | dask.array.core.Array[source]#
Load a raw image file.
- Parameters:
- Raises:
ValueError – Failed to open the image
- Returns:
The loaded image data
- Return type:
np.ndarray[Any, Any]
- paidiverpy.open_layer.utils.load_raw_image_using_path_open(img_path: str | io.BytesIO, image_open_args: dict[str, Any], remote: bool = False) numpy.ndarray[Any, Any] | dask.array.core.Array[source]#
Load a raw image file using the open function.
- Parameters:
- Raises:
ValueError – Failed to open the image
- Returns:
The loaded image data
- Return type:
np.ndarray[Any, Any]
- paidiverpy.open_layer.utils.decode_8bpp(img: numpy.ndarray[Any, Any], image_misc: list[str], width: int, height: int, channels: int, bayer_pattern: str | None = None) numpy.ndarray[Any, Any][source]#
Decode 8-bit per channel image data.
- Parameters:
- Returns:
The decoded image data.
- Return type:
np.ndarray[Any, Any]
- paidiverpy.open_layer.utils.decode_16bpp(img: numpy.ndarray[Any, Any], layout: str = '5:6:5', width: int = 2448, height: int = 2048, endianess: str | None = None) numpy.ndarray[Any, Any][source]#
Decode 16-bit packed RGB into 8-bit per channel RGB based on layout.
- Parameters:
- Returns:
The unpacked 8-bit RGB image data.
- Return type:
np.ndarray[Any, Any]