My app works with photos and videos of people, which I want to cartoonify. 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.
Here's some algorithms to play with:
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.
More edits:
Once you get the idea of Huang's algorithm, implementing a box blur filter is a delicious piece of cake.
Reading material:
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.