First thing in mind:
- Convert images to grayscale
- Divide image into small areas (patches)
- Each patch should be labelled as 1 if entropy of image is high and 0 if low (to discard patches without letters)
- For two images, compare all patches across images based on:
- Histogram on sobel image (Bhattacharya distance is normalized)
- Correlation (Minmax normalization)
- Advanced descriptors (like SIFT) (L2 normalization)
- Min distance wins.
You can narrow down the '1' patches with a text detector (Algorithm to detect presence of text on image).