views:

81

answers:

2

I'm looking for a way to apply a "perspective correction" to an image in an iPhone app.

This question explains how to apply a perspective distortion, what I want is exactly the inverse operation...

Any idea how to do this?

Sample image

A: 

Assuming the transform has an inverse, if you have the original transform then you can use CATransform3DInvert().

If you have a quadrilateral (but not the transform) and want to map it to a square/rectangle, there's plenty of code out there — Googling inverse perspective transform gives a few results. If you're working in homogeneous coordinates, then solve the matrix and invert it (or something).

tc.
A: 

What I finally did was make use of an ImageMagick port to the iPhone, that can be found here.

Just in case someone else needs something like this...

Marcos Crispino