COSIE.image_preprocessing.load_image
- load_image(filename, verbose=True)[source]
Efficiently load an image file and convert it to a NumPy array.
Parameters
- filenamestr
Path to the image file. Supports common formats such as .png, .jpg, .tif.
- verbosebool, optional
Whether to print log messages during the loading process. Default is True.
Returns
- imgnp.ndarray
A NumPy array representing the image. Shape is (H, W) for grayscale or (H, W, 3) for RGB images. The alpha channel is removed if present.