Laughing Man in Processing

laughing_man

The Laughing Man is the antagonist from the anime series Ghost in the Shell: Stand Alone Complex. During each of his public appearances in the series he manages to hack all video feeds/cyborg eyes in the vicinity to obscure his face with the logo above.

[Ben Kurtz] had been watching the series recently and realized he could put together a similar effect using Processing. The interesting bit, and what makes this more fun than a simple demo, is that he’s using the OpenCV library. OpenCV is a open source computer vision library. [Ben] uses it to handle the facial recognition in Processing and then apply the image.

It’s only 100 lines and we wonder what other fun tricks could be employed. Here’s a Hack a Day skull you can swap in for the logo.

[thanks dakami]

49 thoughts on “Laughing Man in Processing

  1. sorry, noob here, when I run the code I get a video window to open, but no face recognition. The bottom window says:

    The haar classifier cascade file ‘haarcascade_frontalface_alt.xml’ can not be found in folders, you must specify the full path instead.

    any ideas?

  2. @zorink

    Change the text:

    OpenCV.CASCADE_FRONTALFACE_ALT

    to

    “C:\\Program Files\\OpenCV\data\\haarcascades\\haarcascade_frontalface_alt.xml”

    include the quotes, and remember to double the backslashes. If that doesn’t work, find where you installed the OpenCV facial recognition profiles and put that in instead.

  3. Sweet! but remember that in GitS SAC, the text around the logo scrolled… someone called deltadesu posted an updated animated version on the comments. He says it’s low res, though.

  4. @TheKhakinator

    make sure you have your opencv/bin directory in your PATH variable. my installer claimed to do so, but did not.

  5. @ben

    that didn’t work either, it didn’t like the \ character

    I finally got it to work by copying the OpenCV.CASCADE_FRONTALFACE_ALT.xml
    into the same directory as the laugh script

    1. processing said OpenCV.CASCADE_FRONTALFACE_ALT.xml cannot be resolved or is not a field.
      and i don’t understand this “copying the OpenCV.CASCADE_FRONTALFACE_ALT.xml
      into the same directory as the laugh script”.
      thanking you in advance

  6. ok so i got this working, but (sorry if this is noob, this is my first experience with processing) how would i go about incorporating this into iChat when i video chat with people? would i have to extract the application to some where in the libraries of Ichat where it would run when the video chat was triggered?

  7. Hah, awesome. I did the same thing with an apple a while back so as to create my own digital version of the “son of man” painting.

    Incidentally, in case anyone is interested, I’m going to be putting up some Processing + OpenCV tutorials on my site probably some time in the next week :)

  8. crap i cant get this to work i keep getting a error message saying that,

    the package “hypermedia” does not exist. You might be missing a library.

    Does anyone know what that means?

  9. Dreamy idea, hardly yet achievable, would be to couple openVC with things like unwarp-mosaic (from siggraph 2008) and then write code automatically morphing all faces in a videoe.g. to smile like joker or aphex twin. Anyone knows of things similar in effect to unwarp-mosaic?

  10. @ Zorink

    I did what you said, by copying the OpenCV.CASCADE_FRONTALFACE_ALT.xml
    into the same directory as the laugh script. Now it opens my webcam, but doesn’t display the logo on my face. Know how to fix this?

  11. @guy
    make sure you copied the right file, there is also one called haarcascade_frontalface_alt_tree.xml
    You can’t normaly see the _tree part

  12. @chaostheory
    Well I found haarcascade_frontalface_alt_tree.xml, it was in C:/Program Files/OpenCV/data/haarcascades/haarcascade_frontalface_alt.xml. Now what am I supposed to do with it? I tried moving it into the same directory as the laugh folder but that didn’t do anything. I feel like such a newb.

  13. Honestly? This is one of the sample programs that comes with openCV, only instead of placing a box around the face, he places an image.

    Sorry, just not impressed.

  14. SERIOUSLY. WHO THE FUCK DID THIS STUPIF PROGRAM?
    IT FUCKING WANNABIE “CRASHES” MY GOD DAMN SERVER.
    no this is not funny, thanx to that fucking idiot who made this i’ve lost 200$ usd.

    The one who did this deserves a bulldozer up his/her ass.

    If i ever get your name ill sue you. Good luck.

  15. @jojo
    Learn how to use “your” and “you’re”.

    ‘you’re’ = you are,
    ‘your’ = possessive pronoun, means that something belongs to you

  16. I have been trying on and off for a year to get
    OpenCV working with Processing sketches.

    I always get:
    The package “Hypermedia” does not exist etc etc warnings on compile.

    Many others have had similar problems – there’s a thread that has been discussing the problem for over a year, with no solution apparent:

    http://processing.org/discourse/yabb2/YaBB.pl?num=1238338691/0

    I have tried all the suggestions on this thread, and many others, on four different Windows XP machines, with every version of OpenCV ever released.
    I can’t get the darn thing to work.

    Is anyone clever enough to have a solution?

  17. processing shows this OpenCV.CASCADE_FRONTALFACE_ALT.xml cannot be resolved or is not a field.
    and i don’t understand this “copying the OpenCV.CASCADE_FRONTALFACE_ALT.xml
    into the same directory as the laugh script”.
    thanking you in advance

  18. I copied this “OpenCV.CASCADE_FRONTALFACE_ALT.xml
    into the same directory as the laugh script”. Now there is no error but cam shows a black screen only no image is there

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s