0

So I have cropped an image using this solution. Is there a way I can deskew the image using source and destination co-ordinates of the corners or another way?

Ideally I want to be able to do this manually without using preset co-ordinates in the script.

For example, a tilted piece of paper in an image like so. I crop the image so just the paper is left but then it is still tilted. So i want to make it as if I am looking directly at it.

  • 2
    For future posts, it would be good to post example javascript or jQuery code so that it could be corrected. Also, there are various sub-sites of stack overflow that would possibly be a better forum for this, if specific code is not involved. – JosephDoggie May 09 '18 at 18:25

1 Answers1

1

The simple answer is "use a transformation matrix". Skewing an image using Perspective Transforms's top answer covers the usage of those in pretty significant detail.

A shear + scale is the easiest, but would warp the image. So you'll need to mix in a perspective map if you want to deal with the warping of the image as objects move "in" or "out" (along the z-plane) of perspective.