如何卡通IFY的图像编程? [英] How to cartoon-ify an image programmatically?

查看:182
本文介绍了如何卡通IFY的图像编程?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

也许你已经注意到了,但卡通ifying你的照片在互联网上最新的愤怒。我的老板现在想要我们的产品,这与照片和人的视频作品,cartoonify他们。所以,我需要一个算法做手工(我们使用C ++ / Qt的为我们的产品,其图像处理类),或者是一些命令行程序,将做到这一点对我来说,我可以打电话和我们自己的应用程序中使用。我已经做了在互联网上的一些prelimanary搜索,但并没有拿出多少...

Maybe you have noticed, but cartoon-ifying your photos is the latest rage on the internet. My boss now wants our product, which works with photos and videos of people, to cartoonify them. So I need an algorithm to do it manually (we use c++/Qt for our product, which has image manipulation classes) or perhaps some CLI program that will do it for me that I can call and use from our own app. I've done some prelimanary searches on the internet, but did not come up with much...

谢谢!

推荐答案

下面是一些算法一起玩:

Here's some algorithms to play with:

  • 中位数或重复中模糊滤镜获得卡通调色板
    • 编辑:的双边滤波应满足您的需求,甚至更好
    • Median or repeated box blur filter to obtain cartoonish color palette
      • Bilateral filtering should suit your needs even better

      这些都是非常基本的,所有很容易实现。请记住,中位数和中模糊过滤器可以用线性时间复杂度WRT实施内核半径。

      These are fairly basic and all very easy to implement. Keep in mind that median and box blur filters can be implemented with linear time complexity w.r.t. the kernel radius.

      更多编辑:

      一旦你得到黄的算法的思想,实现一箱模糊滤镜是一个美味的一块蛋糕。

      Once you get the idea of Huang's algorithm, implementing a box blur filter is a delicious piece of cake.

      阅读材料:

      • 快速中值和双边滤波(获得PDF)
      • 中值滤波常数时间(获得PDF)的注意:的我有这样的一个实现使用单声道/ SIMD加速直方图聚结C#,但它似乎只比的 0 的(研究的)算法更好,当直径超过〜60像素,由于添加的可比数/分指令(盈亏平衡点),一个C ++实现可能更适合驾驭SIMD。
      • Fast Median and Bilateral Filtering (get the PDF)
      • Median Filtering Constant time (get the PDF) Note: I have an implementation of this in C# using Mono/SIMD to accelerate histogram coalescence, however it only seems better than the O(r) algorithm when the diameter exceeds ~60 pixels due to the comparable number of add/sub instructions (the break-even point), a C++ implementation is probably much better suited to harness SIMD.

      其他的阅读材料包括:<一href="http://books.google.no/books?id=8uGOnjRGEzoC&dq=gonzales+digital+image+processing&printsec=frontcover&source=bl&ots=8tVeZu63Zc&sig=KpMRj2SFh8jzLhdRkWpyv1ZsxJg&hl=no&ei=KoOdSry9JM7J-QaUqqXcAg&sa=X&oi=book%5Fresult&ct=result&resnum=3#v=onepage&q=&f=false">Gonzalez &放大器;老虎伍兹的数字图像处理(似乎是一个较旧的版本)的分割和边缘跟踪。 8路边缘跟踪可真的很难各地把你的头(上像素或像素之间的边缘以及如何缠上边缘之间选择)。我很乐意分享一些code,但百套不完全顺畅适合在此处的。

      Other reading materials include Gonzalez & Woods' Digital Image Processing (seems to be an older edition) for segmentation and edge tracing. 8-way edge tracing can be really hard to bend your head around (choosing between on-pixel or between-pixel edges and how to latch onto edges). I'd be happy to share some code, but the hundred-liners don't exactly fit smoothly in here.

      这篇关于如何卡通IFY的图像编程?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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