ios 在ios中将图像转换为卡通

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/10042857/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-30 17:44:41  来源:igfitidea点击:

To Convert Image to Cartoon in ios

iosxcodeimageimage-processingopengl-es

提问by Balan Prabhu

enter image description hereIs there any filters available in ios to convert a image to cartoonistic image like exactly in the above picture?

在此处输入图片说明ios中是否有任何过滤器可以将图像转换为与上图完全相同的卡通图像?

回答by Brad Larson

For a much faster solution than ImageMagick, you could use the GPUImageToonFilter from my GPUImageframework:

要获得比 ImageMagick 快得多的解决方案,您可以使用我的GPUImage框架中的GPUImageToonFilter

Toon filtering

香椿过滤

It combines Sobel edge detection with posterization of the image to give a good cartoon-like feel. As implemented in this framework, it's fast enough to run on realtime video from the iPhone's camera, and is probably at least an order of magnitude faster than something similar in ImageMagick. My framework's also a little easier to integrate with an iOS project than ImageMagick.

它将 Sobel 边缘检测与图像的分色相结合,给人一种卡通般的感觉。正如在这个框架中实现的那样,它的速度足以在来自 iPhone 相机的实时视频上运行,并且可能至少比 ImageMagick 中的类似东西快一个数量级。我的框架也比 ImageMagick 更容易与 iOS 项目集成。

If you want more of an abstract look to the image, the GPUImageKuwaharaFilter converts images into an oil painting style, as I show in this answer.

如果您想要图像的更多抽象外观,GPUImageKuwaharaFilter 会将图像转换为油画风格,如我在此答案中所示

回答by Jonas Schnelli

Try to use imagemagick for iOS http://www.imagemagick.org/download/iOS/Of course you need some serval hours how to use imagemagick for iOS. But then you should also look at: http://www.fmwconcepts.com/imagemagick/cartoon/index.php

尝试在 iOS 上使用 imagemagick http://www.imagemagick.org/download/iOS/当然你需要一些时间来如何在 iOS 上使用 imagemagick。但是你也应该看看:http: //www.fmwconcepts.com/imagemagick/cartoon/index.php

and maybe also on: http://www.imagemagick.org/discourse-server/viewtopic.php?f=1&t=11140&start=0&st=0&sk=t&sd=a

也可能在:http: //www.imagemagick.org/discourse-server/viewtopic.php?f=1&t=11140&start=0&st=0&sk=t&sd =a

回答by samson

This Core Image filter sectionin the iOS dev library, possibly combined with the script referenced by Jonas and a little luck, might get you where you're going. Not sure, having never used either of these technologies.

iOS 开发库中的这个Core Image 过滤器部分,可能结合 Jonas 引用的脚本和一点运气,可能会让你到达你要去的地方。不确定,从未使用过这些技术中的任何一种。