(image hand painted, just for demonstration purposes)
The image has 640x480 pixels.
I'm using the following parameters:
Code: Select all
MagickDistortImage(TheWand, PerspectiveDistortion, [(0.5, 17.5), (0.5, 9.5), (640.5, 29.5), (639.5, 9.5), (640.5, 413.5), (639.5, 444.5), (0.5, 432.5), (0.5, 444.5)], 8, MagickFalse);
The source coordinates specify the red lines on the next picture, the destination coordinates the blue lines. Both use the full width of the image but only part of the height. So source is a trapezoid and destination is a rectangle.
The result is this:
At first glance, it looks fine, but if you look closer, you will see that not just "horizontal" lines have been corrected but also the vertical lines have been moved.
I didn't expect that. Am I doing anything wrong?