First: here is a little sketch
I'm working on a project where I get an image with a quadrilateral on it (the red one). I know the positions of all four points.
Now I want to deskew this quadrilateral to a rectangle with the same size like the original image. Its only allowed to move the corners of the whole image (marked with a blue cycle) each one independently.
I tried with a little bit of math. I created a system of linear equations, but I never get a solution.
I tried to move the edges of the image a little bit and recalculate the edges of the quadrilateral. This isn't working by now but consumed a lot of time.
Now I thought there has to be a algorithm to solve this problem more efficient.
I hope you know a algorithm or have an idea for me.
sincerely, Xean
P.S.: Only core frameworks should be used. Not something like OpenCV.