ImageSegmenter

class giant.image_processing.image_segmenter.ImageSegmenter(options=None)[source]

This class segments images into foreground and background objects using a multi-level Otsu thresholding approach.

It is configured using the ImageSegmenterOptions dataclass, which specifies parameters such as the number of Otsu levels, minimum segment area, and minimum segment DN.

The main functionality is provided by the __call__() method, which takes an input image and returns a ImageSegmenterOut named tuple containing the segmentation results.

Example usage::

segmenter = ImageSegmenter() segment_results = segmenter(image)

Parameters:

options (ImageSegmenterOptions | None) – the options configuring the image segmenter. If None, defaults will be used

Methods

__call__

This method attempts to segment images into foreground/background objects.