pypocquant.lib.io

Module Contents

Functions

load_and_process_image(full_filename: str, raw_auto_stretch: bool = False, raw_auto_wb: bool = False, to_rgb: bool = False)

Load a supported (standard) image file format such as ‘.jpg’, ‘.tif’, ‘.png’ and

is_raw(filename: str) → bool

Check whether the image is one of the supported RAW images

pypocquant.lib.io.load_and_process_image(full_filename: str, raw_auto_stretch: bool = False, raw_auto_wb: bool = False, to_rgb: bool = False)

Load a supported (standard) image file format such as ‘.jpg’, ‘.tif’, ‘.png’ and some RAW file formats (‘.nef’, ‘.cr2’, .’arw’).

Parameters
  • full_filename (str) – Full path to the file to open.

  • raw_auto_stretch (bool) – (Only applies to RAW image file formats). Set to True to automatically stretch image intensities (default = False).

  • raw_auto_wb (bool) – (Only applies to RAW image file formats). Set to True to automatically apply white-balancing (default = False).

  • to_rgb (bool) – Set to True to convert from BGR (openCV standard, used in processing) to RGB (for display, default = False).

Returns

image: Loaded (and possibly processed) image, or None it the image could not be opened.

Return type

cv2.Image

pypocquant.lib.io.is_raw(filename: str) → bool

Check whether the image is one of the supported RAW images (by checking the file extension.

Parameters

filename (str) – Full file name.

Returns bool

True if the image is RAW, false otherwise.

Return type

bool