Comprehensive image processing and computer vision library for Python with algorithms for filtering, morphology, segmentation, and feature detection
—
Image input/output operations for reading and writing images in various formats. Supports single images, image collections, multi-frame images, and metadata handling.
def imread(fname, as_gray=False, plugin=None, **plugin_args):
"""
Load image from file.
Parameters:
fname : str
Image filename or URL
as_gray : bool, optional
Convert to grayscale
plugin : str, optional
Plugin to use for reading
**plugin_args
Additional plugin arguments
Returns:
ndarray
Image array
"""
def imsave(fname, arr, plugin=None, check_contrast=True, **plugin_args):
"""
Save image array to file.
Parameters:
fname : str
Output filename
arr : array_like
Image array to save
plugin : str, optional
Plugin to use for writing
check_contrast : bool, optional
Check for low contrast
**plugin_args
Additional plugin arguments
"""class ImageCollection:
"""
Load and manage collections of images.
Parameters:
load_pattern : str or list
Pattern or list of image files
conserve_memory : bool, optional
Load images on demand
load_func : callable, optional
Custom loading function
"""
def __init__(self, load_pattern, conserve_memory=True, load_func=None):
pass
def imread_collection(load_pattern, conserve_memory=True, plugin=None, **plugin_args):
"""
Load image collection from pattern.
Parameters:
load_pattern : str or list
Pattern or list of image files
conserve_memory : bool, optional
Load images on demand
plugin : str, optional
Plugin to use
**plugin_args
Additional plugin arguments
Returns:
ImageCollection
Collection of images
"""
class MultiImage:
"""
Handle multi-page/multi-frame images.
Parameters:
filename : str
Image filename
conserve_memory : bool, optional
Load frames on demand
**kwargs
Additional arguments
"""
def __init__(self, filename, conserve_memory=True, **kwargs):
pass
def concatenate_images(images):
"""
Concatenate images into single array.
Parameters:
images : iterable
Images to concatenate
Returns:
ndarray
Concatenated image array
"""from typing import Union, List, Optional, Callable
from numpy.typing import NDArray
import numpy as np
# I/O types
ImagePath = Union[str, bytes]
ImageArray = NDArray[np.number]
ImageList = List[ImageArray]
LoadFunction = Callable[[str], ImageArray]Install with Tessl CLI
npx tessl i tessl/pypi-scikit-image