I have a set of binarized images containing forms, each image follows one of N layouts. There are a few outliers which do not follow a layout and contain random text and images.
The distance between two images can be calculated, as the number of intersecting black pixels. High overlap means the images are more likely to depict the same form.
Are there any algorithms that can cluster the images without computing all pairwise distances, i.e. iteratively or online? I would like to cluster the images by the forms used in each image. Outliers should be detected and not end up within any cluster.
Ideally in Python, using scipy.