WebService::Kaolabo - This module call Kaolabo API (http://kaolabo.com/).
use WebService::Kaolabo; $kaolab = WebService::Kaolabo->new({ target_file => 'sample.jpg', apikey => 'hogefuga' }); unless ( $kaolab->scale( xpixels => 50, ypixels => 50, type => 'max') ) { warn "Failed scale $WebService::Kaolabo::errstr"; } my $res = $kaolab->access(); if ( $res->is_success ) { warn "Success "; } #$kaolab->unface_area(); for my $k ( @{$kaolab->face_area()} ){ $k->{area_number} $k->{min_x}; $k->{min_y}; $k->{max_x}; $k->{max_y}; $k->{point}; } my $face_data = $kaolab->face_data; for my $f ( @{$face_data} ){ $f->{face_x}; $f->{face_y}; $f->{height}; $f->{width}; $f->{right_eye_y}; $f->{left_eye_y}; } $kaolab->effect_face({type=>'box', color=>'#FF0000'}); $kaolab->write('output.jpg'); #my $imager = $kaolab->imager; #$imager->write(type=>'jpeg', file=>'output.jpg');
The image file and api_key are passed. And Create new instance. The image should be JPEG.
Call The Kaolab API . The return value is a response object. See HTTP::Response.
Call Imager scale method. See "scale" in Imager::Transformations.
This method draws the line or box on the face.
The line is drawn on eyes.
$kaolab->effect_face({type=>'line', color=>'#FF0000'});
The box is drawn on faces.
$kaolab->effect_face({type=>'box', color=>'#FF0000'});
Write an image to a file.
The Imager instance is returned.
The image file is delimited to nine areas. Return face area.
Return no face area.
Return average width of all faces.
Return average height of all faces.
Error message.
warn "$WebService::Kaolabo::errstr";
Kaolab API http://kaolabo.com/webapi Kaolab http://kaolabo.com/
Akihito Takeda <takeda.akihito@gmail.com>
<takeda.akihito@gmail.com>
Copyright (c) 2008, Akihito Takeda <takeda.akihito@gmail.com>. All rights reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic.
To install WebService::Kaolabo, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WebService::Kaolabo
CPAN shell
perl -MCPAN -e shell install WebService::Kaolabo
For more information on module installation, please visit the detailed CPAN module installation guide.