MCPcopy Create free account
hub / github.com/Vinyzu/recognizer / create_image_grid

Function create_image_grid

recognizer/components/image_processor.py:98–112  ·  view source on GitHub ↗
(images: List[cv2.typing.MatLike])

Source from the content-addressed store, hash-verified

96
97
98def 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
115def handle_single_image(single_image: Union[Path, bytes], area_captcha: bool) -> Tuple[List[bytes], List[Tuple[int, int]]]:

Callers 2

detect_imageMethod · 0.85
detectMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected