简体   繁体   English

将图像放在从相机捕获的图像上

[英]Put an image over capture image from camera

嗨,我正在开发一个应用程序,其中我将使用相机拍摄照片,然后在其上放置诸如眼镜,头发等图像。任何人都可以让我知道它是如何完成的。我也必须保存该图像。互联网,但找不到任何相关的东西。

You can use Apple's ' Detecting Faces in an Image ' found in Core Image Programming Guide. 您可以使用《核心图像编程指南》 中的 Apple的“ 在图像中检测面部 ”。 Getting the face and face feature bounds includes left eye, right eye and mouth - x and y positions. 获取面部和面部特征范围包括左眼,右眼和嘴巴-x和y位置。 Once you have those, it's a matter of adding a subview to the desired coordinates with any picture you like (glasses for example). 一旦有了这些,就可以将子视图添加到所需坐标上,并带有所需的任何图片(例如,眼镜)。

Depending on the distance between the mouth and the eyes, you can probably come up with some average distance to the top of the head if you want to add hair. 如果要添加头发,根据嘴巴和眼睛之间的距离,您可能会得出到头部顶部的一些平均距离。 Trial and error. 反复试验。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM