Using of OpenCV to recognize patterns in a image, including rotated and rescaled ones, and perspective