{'fraction_non_alphanumeric': 0.025174825174825177, 'fraction_numerical': 0.0, 'mean_word_length': 5.36, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Similarity-transform invariant similarity measure for robust template matching

A good similarity measure is the key to robust template matching. In this paper, we present a Similarity-Transform invariant Best-Buddies Similarity (SiTi-BBS) to deal with the template matching with obvious geometric distortion. Similar to the BBP, SiTi-BBS still adopts Best-Buddies Pair (BBP) to vote. However, differing from the classic BBS acquiring the point pair via bidirectional matching in xyRGB space, SiTi-BBS takes only the color information (RGB components) to acquire BBPs, while the position information (xy components) of each BBP is employed to calculate the geometric distortion between the template and matching window. To further improve the robustness of template matching, we novelly take advantage of the interval voting to accommodate the case where the two images do not strictly satisfy the similarity transformation. Therefore, SiTi-BBS, to a certain extent, can be applied to the affine and perspective transformation. In this way, the highest number of votes is taken as the similarity measure between the two images. Mathematical analysis indicates that the proposed method is capable of dealing with the case of obvious geometric distortion between images. Furthermore, the test results of simulated and real challenging images show the outstanding performance of the proposed similarity measure for template matching.