## 2 Proposed Approach and Its Verification
### Mutual Similarity of Binary Images
Obviously, as it may be noticed in Figures 1-4, some binarization methods have caused the loss of data and some characters are impossible to recognize. During the experiments, some classical metrics based on the confusion matrix, typically used for the evaluation of binarization methods, as well as for performance metrics for pattern recognition or classification purposes, have been used, mainly due to their fast computation. The most widely known such metrics include Precision (defined as the ratio of true positives to all predicted positives) and Recall/Sensitivity (ratio of true positives to all actual positives), where black pixels representing the foreground information are considered positives and white background pixels negatives. The other metrics, based on similar computations, are F-Measure (harmonic mean of Precision and Recall), Accuracy (ratio of the sum of all true positives and true negatives to all pixels), pseudo-Precision, pseudo-Recall, pseudo-F-Measure, and Specificity [19], as well as the less popular Peak Signal-to-Noise Ratio (PSNR), Balanced Classification Rate (BCR), S-F-Measure, and Geometric Accuracy. Nevertheless, the evaluation of image binarization results may also be conducted using some other approaches considered in this paper. The first interesting idea is the application of the Border Distance proposed by [PERSON] et al. [10]. This method is based on the assumption that the Border Distance of the modified pixels plays an important role in the binary image quality evaluation and the larger distances are related to worse image quality due to their larger influence. Since the distance may be defined in various ways, three approaches are considered based on the chessboard, city block, and Euclidean distances, leading to three types of the BDPSNR metric. Another approach to binary image quality evaluation is the application of the Distance Reciprocal Distortion (DRD) metric [7]. This metric also utilizes the observation that the quality perception of document images is dependent on the distance between two pixels. Therefore, it is assumed that the influence of the horizontal and vertical neighbors is higher than the diagonal ones. All pixels differing between two compared images are then weighted by the reciprocal of a distance to the central pixel using the \(5\times 5\) pixel weighting matrix. Then, the local DRD values are computed for the neighborhoods of the flipped pixels, further aggregated, and divided by the number of \(8\times 8\) pixel blocks containing at least two differing pixels in the reference image (fully white and fully black blocks are excluded). The last considered binary IQA metric is the Misclassification Penalty Metric (MPM), proposed in the paper [8], based on the idea of the penalization of the misclassified pixels depending on distances from the border of the reference objects. After the division of the obtained result by the sum of all pixel-to-contour distances in the image, the normalized value of the metric is obtained. The approach proposed in the paper is based on the application of several of the above metrics for the calculation of mutual similarities between pairs of binary images obtained from the same color or greyscale input image. Since most of the considered thresholding methods belong to the family of adaptive binarization algorithms, one may expect quite similar results obtained even for non-uniformly illuminated images. Therefore, it is proposed to calculate mutual similarity values pairwise for each combination of two binary images originating from the same input image applying the selected metrics. The most appropriate binarization methods should not produce images strongly differing from the results obtained using the other thresholding algorithms; hence, the final OCR result's quality should also be better than that achieved using the other binarization methods.