## 2 Proposed Approach and Its Verification  
### Mutual Similarity of Binary Images  
The proposed idea of a fast prediction of the OCR results' quality based on the application of binary image quality assessment makes it possible to significantly reduce the computational burden and prevent the text recognition for low quality images containing some areas with unreadable characters. It utilizes the mutual comparisons of binary images obtained using various thresholding methods; however, the comparisons may be conducted using various methods. According to the assumptions related to the highest mutual similarity of high-quality binary images, the experimental verification of the idea has been conducted using the designated dataset based on the WEZUT OCR Dataset [11], which contains 176 non-uniformly illuminated document images with the commonly used placeholder text \"Lorem ipsum\". The WEZUT OCR dataset is available at [[https://okarma.zut.edu.pl/?id=dataset](https://okarma.zut.edu.pl/?id=dataset)]([https://okarma.zut.edu.pl/?id=dataset](https://okarma.zut.edu.pl/?id=dataset)) (accessed on 12 October 2024). All images have been captured by a Digital Single-Lens Reflex (DSLR) camera Nikon N70 and their size is 2861 \(\times\) 1965 or 2872 \(\times\) 1940 pixels. This dataset has been extended using various image binarization algorithms, further applied instead of the default first step of the OCR algorithm. Finally, the dataset of binary images consisting of 1760 images has been created as a result of the application of the following adaptive image binarization methods: [PERSON] [12], [PERSON] [13], [PERSON] [14], [PERSON], NICK [15], [PERSON] [16], [PERSON] [17], and [PERSON] [18]. Additionally, two methods based on deep learning proposedby [PERSON] (the code is available at [[https://github.com/sliedes/binarize--accessed](https://github.com/sliedes/binarize--accessed)]([https://github.com/sliedes/binarize--accessed](https://github.com/sliedes/binarize--accessed)) on 12 October 2024) and Masyagin (ROBIN--RObuset document image BINarization tool--the code is available at [[https://github.com/masyagin1998/robin--accessed](https://github.com/masyagin1998/robin--accessed)]([https://github.com/masyagin1998/robin--accessed](https://github.com/masyagin1998/robin--accessed)) on 12 October 2024) have been used. Obviously, global image thresholding methods have not been applied due to their inadequacy for non-uniformly illuminated document images. The illustrations of some binarization results obtained for a representative sample image are presented in Figures 1-4.  
above. The obtained text recognition results for each image have been compared with the \"ground-truth\" text provided in the WEZUT OCR Dataset and then the Levenshtein Distance (LD) between those two strings has been calculated. The computation of the classical Levenshtein Distance, also known as edit distance, is based on the counting of the number of simple edits necessary to convert one string into another. The operations considered as simple edits are character insertion, deletion, and substitution. Since the WEZUT OCR Dataset contains photos of the documents printed using five different popular font shapes (Arial, Times New Roman, Calibri, Courier, and Verdana) with some typical modifications of attributes (normal, bold and italic versions of all fonts, as well as bold italics), each of the 1760 images obtained after thresholding has been compared with their equivalents obtained from the same source image using the other binarization methods. Finally, the nine similarity values have been averaged, leading to an aggregated mutual quality index. Then, the Pearson's linear correlation coefficient values between them and the Levenshtein Distances computed for the same image have been determined to verify the appropriateness and usefulness of each image quality/similarity metric for the prediction of the quality of OCR results.