(images: List[cv2.typing.MatLike])
| 96 | |
| 97 | |
| 98 | def create_image_grid(images: List[cv2.typing.MatLike]) -> cv2.typing.MatLike: |
| 99 | cv2_images = images |
| 100 | tile_count_per_row = int(math.sqrt(len(cv2_images))) |
| 101 | |
| 102 | # Combining horizontal layers together |
| 103 | layers = [] |
| 104 | for i in range(tile_count_per_row): |
| 105 | layer_images = [cv2_images[i * tile_count_per_row + j] for j in range(tile_count_per_row)] |
| 106 | layer = concatenate(layer_images, axis=1) |
| 107 | layers.append(layer) |
| 108 | |
| 109 | # Combining layers verticly to one image |
| 110 | combined_img = concatenate(layers, axis=0) |
| 111 | |
| 112 | return combined_img |
| 113 | |
| 114 | |
| 115 | def handle_single_image(single_image: Union[Path, bytes], area_captcha: bool) -> Tuple[List[bytes], List[Tuple[int, int]]]: |
no outgoing calls
no test coverage detected