Matthias Bisping 3b18fc6158 refactoring
2022-04-08 13:56:57 +02:00

12 lines
514 B
Python

from typing import Iterable
from image_prediction.image_extractor.extractor import ImageMetadataPair
from image_prediction.stitching.merging import merge_along_both_axes, no_new_merges
from image_prediction.utils.generic import until
def stitch_pairs(pairs: Iterable[ImageMetadataPair]) -> Iterable[ImageMetadataPair]:
"""Given a collection of image-metadata pairs from the same pages, combines all pairs that constitute adjacent
images."""
return until(no_new_merges, merge_along_both_axes, pairs)