I have a image from scanner:
You can see that the right side of this paper is very flat, but it's curved in the left side. I think maybe I can detect the edge of this paper and then build some model and make it deform to a flat paper. But it's a little difficult.
p = Import["https://i.stack.imgur.com/r6g4b.png"];
p2 = DeleteSmallComponents@Binarize[p, 0.1];
corners = ImageCorners[p2, 10, .001, MaxFeatureDisplacement -> 10];
Show[HighlightImage[p2, corners], ImageSize -> 400]