darsia.detect_color#

detect_color(img, color, tolerance=0.01)[source]#

Detects a color in an image.

Parameters:
imgdarsia.OpticalImage

The image to detect the color in. Assumed to be in RGB format. With values in the range [0, 1].

colorUnion[list[float], np.ndarray]

The color to detect, assumed to be in RGB format. With values in the range [0, 1].

tolerancefloat, optional

The tolerance for the color detection. Defaults to 0.1.

Returns:
darsia.VoxelArray

Pixels with the detected color.