utils
crop_and_save_image(input_path:str, output_path:str, x1:int, y1:int, x2:int, y2:int)
Crops a region from the input image and saves it to the output path.
Parameters:
input_path
(str): Path to the input image.output_path
(str): Path to save the cropped image.x1
(int): Top-left x-coordinate.y1
(int): Top-left y-coordinate.x2
(int): Bottom-right x-coordinate.y2
(int): Bottom-right y-coordinate.
Returns:
None
: NoneRaises:
ValueError
: If the crop coordinates are invalid or image cannot be loaded.
Examples:
>>> crop_and_save_image("input.jpg", "output.jpg", 10, 20, 100, 200)
Labels:
src_PyThon_ContactAngle_DropDetection_utils_crop_and_save_image