Frank Krueger
2009-03-19 04:34:03
The problem is, how do you convert the 4 points into a 3D rotation?
Neil N
2009-12-14 17:19:16
+2
A:
The keyword here is homography. Manolis Lourakis has written a GPL'ed homography implementation in C that is available here; however, this will not be able to be ported very easily because it relies on some external libraries such as LAPACK.
Adam Rosenfield
2009-03-19 04:42:33
+2
A:
Disclaimer: I work at Atalasoft
If you are willing to go commercial, DotImage Photo can do this with the QuadrilateralWarpCommand. Sample C# Code
// Load an image.
AtalaImage image = new AtalaImage("test-image.jpg");
// Prepare the warp positions.
Point bottomLeft = new Point(100, image.Height - 80);
Point topLeft = new Point(130, 45);
Point topRight = new Point(image.Width - 60, 140);
Point bottomRight = new Point(image.Width - 20, image.Height);
// Warp the image.
QuadrilateralWarpCommand cmd = new QuadrilateralWarpCommand(bottomLeft,
topLeft, topRight, bottomRight, InterpolationMode.BiLinear, Color.White);
AtalaImage result = cmd.Apply(image).Image;
Lou Franco
2009-03-19 12:17:54
I don't believe you can get this with an Affine warp (at least not 2d) We support several common affine transformations, and you can make your own 2D matrix. We don't support 3D transformations (which is what I think you would need to do this kind of transformation using a matrix).
Lou Franco
2009-03-19 15:30:51
+4
A:
Check out the Perspective warping examples from ImageMagick. It is available for most mainstream platforms.
unwind
2009-03-19 12:25:43