Miyagawanize
Upcoming SlideShare
Loading in...5
×
 

Like this? Share it with your network

Share

Miyagawanize

on

  • 3,165 views

 

Statistics

Views

Total Views
3,165
Views on SlideShare
2,420
Embed Views
745

Actions

Likes
0
Downloads
6
Comments
0

6 Embeds 745

http://yusukebe.com 562
http://kamawada.com 167
http://webcache.googleusercontent.com 7
http://yusukebe.typepad.jp 6
http://www.slideshare.net 2
http://webryreader.sso.biglobe.ne.jp 1

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

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!!