COSIE.image_preprocessing.combine_mask

combine_mask(image_path, mask_path, output_path)[source]

Modify a grayscale image by applying a binary mask. All pixels in the input image corresponding to white (255) pixels in the mask will be set to black (0). This is useful when a specific region needs to be recovered as black based on a mask.

Parameters

image_pathstr

Path to the input grayscale image to be modified.

mask_pathstr

Path to the binary mask image. Must be the same size as the input image.

output_pathstr

Path to save the modified image.

Returns

None

The modified image is saved to the specified output path.