I'm trying to take a picture taken with a scanner (or perhaps a mobile phoneβs camera) with different quality and distortion, and rebuild it with a basic image (the one that was created through Photoshop, before it was printed and scanned) to be as possible nearer.
The image has four thick corner points in each of the corners, which I used by the primitive method to find four points, and then use the perspective transform on the scanned image. However, my algorithm is completely brute force and breaks down a lot.
I tried using cvGoodFeaturesToTrack (), but I can't think of an exact way to make sure that the four points for calibration are accurate under any circumstances. I was thinking about using pattern matching, but it looks like it will work reliably under various distortions. I see many methods for performing specific tasks, such as finding contours, key points, lines, etc., but it does not indicate what to actually do with them.
Is there a better way that I just don't see?
Thanks!
source share