undistorting/ dewarping a picture with 4 points on a plane
distortion, opencv, python
Solution
To calculate this matrix, use :
cv2.getPerspectiveTransform(src, dst)
With src a list containing your 4 points and dst a list containing the corners of the new image. Be careful, they must be in the right order
Problem
I'd like to `dewarp` an image using `python` (`opencv/PIL` etc.). I have 4 points of which I know that they should form a rectangular on a plane. In gimp I can manually `dewarp` the picture using`backwards-correction`, but I'd like to write a program, that doesn't rely on `gimp`. All the functions I have found rely on a transformation `matrix`, so I guess it would be sufficient to give me some pointers on how to calculate the correct `matrix`. Greets & thanks for the help