开发者

UIImage perspective correction

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

This question 开发者_C百科explains how to apply a perspective distortion, what I want is exactly the inverse operation...

Any idea how to do this?

UIImage perspective correction


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).


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...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜