Dmitry Kosenkov > Image-Resize-OpenCV-0.11 > Image::Resize::OpenCV

Download:
Image-Resize-OpenCV-0.11.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.11   Source  

NAME ^

Image::Resize::OpenCV - Simple image resizer using OpenCV

SYNOPSIS ^

    use Image::Resize::OpenCV;
    $image = Image::Resize::OpenCV -> new('large.jpg');
    print ("WIDTH:" . $image -> width . " HEIGHT:" . $image -> height);
    $image -> resize(250, 250);
    $image -> save("small.jpg");

    # OR

    use Image::Resize::OpenCV qw(image_resize);
    image_resize('large.jpg', 250, 250);

DESCRIPTION ^

  Image::Resize::OpenCV using openCV library for resize images. openCV more faster then GD, ImageMagick, GraphicsMagick etc.
  OpenCV more quality then GD and have 4 interpolation mode for resize images.

EXPORT

  image_resize($filename, $width, $height, $out_filename = undef);

METHODS ^

new($filename = undef) - Constructor

    Create a new mage::Resize::OpenCV object 

    my $image = new Image::Resize::OpenCV();
    my $image = new Image::Resize::OpenCV($filename);

load($filename) - Load image file

    $image -> load($filename);

resize($width, $height, ...) - Resize Image

    $image -> resize(640, 480);
    $image -> resize(640, 480, KEEP_ASPECT => 1);
    $image -> resize(640, 480, INTER => 1);
    $image -> resize(640, 480, KEEP_ASPECT => 1, INTER => 1);
    
    # INTER - Interpolation:
    # 0 - nearest-neigbor
    # 1 - bilinear
    # 2 - pixel area relation
    # 3 - bicubic

save($filename, $compress = 25) - Save image

    $image -> save('/tmp/11.jpg');
    $image -> save('/tmp/11.jpg', 50);

width()

height()

SEE ALSO ^

http://sourceforge.net/projects/opencvlibrary/

AUTHOR ^

Dmitry Kosenkov, <junker@front.ru>

COPYRIGHT AND LICENSE ^

Copyright (C) 2011 by Dmitry Kosenkov

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.14.1 or, at your option, any later version of Perl 5 you may have available.

syntax highlighting: