Need to use rotation and scale invariant approach. Also need a threshold based area segmentation before feature extraction is needed. I suggest to follow below steps:
1/ Binary threshold & scan line algorithm can be used to segment specific text line area.
2/ After segmentation you should adjust the rotation using warpAffine transformation. See this example
3/ On adjusted image you can apply SIFT or BRISK or SURF features to get features
4/ Use template matching approach to match or generate similarity or distance score.
see following link for more detail:
scale and rotation Template matching
getAffineTransformto directly obtain the transform you need ;)minAreaRectof both texts, warp one onto the other, compute theabsdiff, sum up the differences. That would be a measure of dissimilarity. This would be fairly fast