(input_folder, output_folder, flow_output_folder, provided_image_path, max_dimension)
| 103 | return warped_image |
| 104 | |
| 105 | def process_images(input_folder, output_folder, flow_output_folder, provided_image_path, max_dimension): |
| 106 | if not os.path.exists(output_folder): |
| 107 | os.makedirs(output_folder) |
| 108 | if not os.path.exists(flow_output_folder): |
| 109 | os.makedirs(flow_output_folder) |
| 110 | |
| 111 | image_files = sorted(glob.glob(os.path.join(input_folder, '*.png'))) |
| 112 | num_images = len(image_files) |
| 113 | |
| 114 | if num_images < 1: |
| 115 | raise ValueError("At least one image is required to compute optical flow.") |
| 116 | |
| 117 | provided_image = read_image(provided_image_path) |
| 118 | provided_image = resize_image(provided_image, max_dimension) |
| 119 | |
| 120 | for i in range(num_images - 1): |
| 121 | image1 = read_image(image_files[i]) |
| 122 | image2 = read_image(image_files[i + 1]) |
| 123 | |
| 124 | provided_image = process_image(image1, image2, provided_image, output_folder, flow_output_folder, max_dimension, i) |
| 125 | |
| 126 | def main(): |
| 127 | input_folder = "Input_Images" |
nothing calls this directly
no test coverage detected