在杯子上合并并包裹UIImage [英] Merge and wrap UIImage on mug

查看:117
本文介绍了在杯子上合并并包裹UIImage的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个图像,我想合并这两个图像,就像我有一个杯子的图像,第二个图像是任何图像。现在我想和它合并到杯子我怎么能实现这个,就像放在杯子上的图像必须首先包起来,就像我从相机拍摄照片而不是将其粘贴到杯子中但我如何包装该图像!

I have two images and I want to merge those two images like I have a image of mug and second image is any image. Now I want to merge with it to mug how could I achieve this like the image which will placed on mug must wrap up first like I take pic from camera and than paste that into mug but how I wrap that image!

推荐答案

@Akhil:你问的是一个非常复杂的问题,这个问题超出了简单的iOS开发领域。如果您的问题具体是将图像包装在马克杯上,那么可以将其视为将纹理应用于网格对象,在这种情况下,您将希望使用OpenGL ES,并具有预定义模型(使用UV贴图)将图像/纹理应用于。

@Akhil: You are asking a very complicated question that goes out of the realm of simple iOS development. If your question is specifically, "wrap an image on a mug," then it can be approached as, "apply a texture to a mesh object," in which case you'll want to be using OpenGL ES, and have predefined models (with UV mapping) to apply the image/texture on to.

此外,您可以使用OpenGL并执行网格网格平移(网格扭曲) - 也就是说您将在网格上拍摄图像(使用(网格)分辨率),然后操纵所有点以创建扭曲效果。此外,GLKit可能有助于此过程,Core Image也可以提供一个简单的解决方案。

In addition, you could use OpenGL and perform a grid mesh translation (mesh warping)—that is to say you'll take an image on a mesh (with a (grid) resolution) and then manipulate all of the points to create the warp effect. Also, GLKit may help in this process and Core Image may also provide a simple solution.

如果您有疑问,我有一个随机图像,我想派生它的3D形状,然后将第二个图像应用到派生的形状并将它们合成在一起,这更加棘手,因为第一部分将采用高级图像处理来确定原始对象/选择形状。

If you're question is, I have a random image and I want to derive the 3D shape of it, then apply a second image to the derived shape and composite them together, that's even trickier as the first part will take advanced image processing to determine the original object/selection shape.

以下是一些其他信息:

  • Apple's GLCameraRipple sample code: http://developer.apple.com/library/ios/#samplecode/GLCameraRipple/Introduction/Intro.html
  • Paper on Image Warping (PDF): http://www.seas.upenn.edu/~cse399b/Lectures/CSE399b-07-warp-mesh.pdf
  • OpenGL reference for image warping: http://paulbourke.net/dataformats/meshwarp/
  • Tutorials for GLKit: http://maniacdev.com/ios-5-sdk-tutorial-and-guide/glkit/
  • Tutorials for Core Image: http://maniacdev.com/ios-5-sdk-tutorial-and-guide/core-image-example/
  • A handout from NTU on image warping (PDF): http://www.csie.ntu.edu.tw/~cyy/courses/vfx/05spring/lectures/handouts/lec03_morphing_4up.pdf
  • Associated information from StackOverflow: iOS images in a bubble effect

欢呼并祝你好运!

这篇关于在杯子上合并并包裹UIImage的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆