As Vitaliy Kaurov's answer mentioned, anyone can use a method based on Neural Network (NN) to give a try? Then the bounty is deserved.
Suppose I have a empty paper like

Then I write some text on the paper,then the result paper have been distorted,rotated and translated.like

How to adjust the result papper according the original empty paper? As you see,some empty transverse line can align this two images. The result like following is expected.

Actually I think the ImageAlign can help me(it cannot align a distorted image as its documentation).
ImageAlign[template, img, TransformationClass -> "Similarity"]
But it is a very slow and give me a poor result.Can anybody give a better solution for this?


ImageMultiply[template, ImageAlign[template, img, TransformationClass -> "Perspective"]]may demonstrate, even an unrestricted linear transform works not too bad for the given example, and also is not really slow. – UDB Aug 25 '17 at 19:00ImageMultiply[#1, ImageAlign[#1, #2, TransformationClass -> "Perspective"]] &[Import@"https://i.stack.imgur.com/euyxY.jpg", Import@"https://i.stack.imgur.com/fymre.jpg"]and tell us what you see. – UDB Aug 26 '17 at 13:31