Miyagawanize

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    Favorites, Groups & Events

    Miyagawanize - Presentation Transcript

    1. miyagawanize Yusukebe YAPC::Asia 2009 Lighting Talk
    2. Tatsuhiko Miyagawa
      • One of Super Geeks!
      • Every Perl Mongers want to write a code like him.
      But…
      • We can’t be Tatsuhiko.
      • Because we lose the “PURPLE THING” .
    3. PURPLE THING
    4.  
    5. What’s This??
      • I don’t know what is this purple thing.
      • But we need this to be like Tatsuhiko!
      • So, I made a “miyagawanize” script.
      • Like “geek face generator” by Yappo-san.
    6. How to make “miyagawanize”
      • Make a image of purple thing.
      • Install OpenCV library.
      • Install “Imager” and “Image::ObjectDetect” modules from CPAN.
      • Write a short script.
      • Run a script.
    7. #!/usr/bin/perl use strict; use warnings; use Imager; use Image::ObjectDetect;
    8. my $file = shift or die "image file path is required!"; my $image = Imager->new->read( file => $file ); my $cascade = './haarcascade_frontalface_alt2.xml'; my $detector = Image::ObjectDetect->new($cascade); my @faces = $detector->detect($file); my $purple_source = Imager->new->read(file => './purple.png'); my $aspect = 1.5;
    9. for my $face (@faces) { my $purple = $purple_source->scale( xpixels => $face->{width} / $aspect, ypixels => $face->{height} / $aspect, ); $image->rubthrough( tx => $face->{width} / $aspect / 2 + $face->{x}, ty => $face->{height} / $aspect + $face->{y}, src => $purple, ); } $image->write( file => './output.jpg' );
    10. DEMO
    11. Let’s “miyagawanize”, And write a great code! Thanks to Tatsuhiko Miyagawa!!

    + yusukebeyusukebe, 2 months ago

    custom

    733 views, 0 favs, 2 embeds more stats

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 733
      • 526 on SlideShare
      • 207 from embeds
    • Comments 0
    • Favorites 0
    • Downloads 3
    Most viewed embeds
    • 206 views on http://yusukebe.com
    • 1 views on http://webryreader.sso.biglobe.ne.jp

    more

    All embeds
    • 206 views on http://yusukebe.com
    • 1 views on http://webryreader.sso.biglobe.ne.jp

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories