2D distortion of a face from an image on iOS? (similar to Fat Booth etc.)

巧了我就是萌 提交于 2019-12-30 01:39:27

问题


I was just wondering if someone knows about some good library or tutorial on how to achieve a 2D distortion of a face taken from an image taken by the user.

I would like to achieve a similar effect to the one in Fatify, Oldify, all those Fat Booths, etc., because I am creating an app where you will throw something at the face and I would the face to jiggle and move when the object hits it.

How should I do this?


回答1:


I have found an almost identical question here with an accepted answer.

Also, speaking about distorsion algorithms there is an algorithm used by GIMP called "liquid rescale". You can find it here and is written in C/C++ so you could integrate it in your iOS App (license permitting, I haven't checked that).

Here is another similar question as well.

Hope that this helps to get you started on this.

EDIT: Some examples (will post some code soon)

EDIT 2: I was looking for some code and I found some blog posts that explain the filtering algorithms used to implement the liquid rescale algorithm. Is not easy and I don't think in short time and with no prior knowledge on the subject I could do more than sharing this link. The author of the GIMP implementation appears to be called "Shai Avidan" (see this post). I suggest you might try to contact him or anyone else in the field (see wikipedia references on the subject). Sorry if I can't help more.

EDIT 3: I found a book with some JAVA code on "Principles of Digital Image Processing: Fundamental Techniques".

Also, this is a link to a Digital Image Processing course by Prof. Bernd Girod at Standford University. There are slides and tutorials.

Then I found some more results by googling the term "Principles of Digital Image Processing spring".

Anyway.. this was just to add some extra to the answer as I was thinking about it before.



来源:https://stackoverflow.com/questions/11126067/2d-distortion-of-a-face-from-an-image-on-ios-similar-to-fat-booth-etc

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!