computer_vision.intensity_based_segmentation

Attributes

image_path

Functions

segment_image(→ numpy.ndarray)

Performs image segmentation based on intensity thresholds.

Module Contents

computer_vision.intensity_based_segmentation.segment_image(image: numpy.ndarray, thresholds: list[int]) numpy.ndarray

Performs image segmentation based on intensity thresholds.

Args:

image: Input grayscale image as a 2D array. thresholds: Intensity thresholds to define segments.

Returns:

A labeled 2D array where each region corresponds to a threshold range.

Example:
>>> img = np.array([[80, 120, 180], [40, 90, 150], [20, 60, 100]])
>>> segment_image(img, [50, 100, 150])
array([[1, 2, 3],
       [0, 1, 2],
       [0, 1, 1]], dtype=int32)
computer_vision.intensity_based_segmentation.image_path = 'path_to_image'