Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

image::seek(3pm) [debian man page]

Image::Seek(3pm)					User Contributed Perl Documentation					  Image::Seek(3pm)

NAME
Image::Seek - A port of ImgSeek to Perl DESCRIPTION
use Image::Seek qw(loaddb add_image query_id savedb); loaddb("haar.db"); # EITHER my $img = GD::Image->newFromJpeg("photo-216.jpg", 1); # OR my $img = Imager->new(); $img->open(file => "photo-216.jpg"); # OR my $img = Image::Imlib2->load("photo-216.jpg"); # Then... add_image($img, 216); savedb("haar.db"); my @results = query_id(216); # What looks like this photo? remove_id(216); # Just remove id from database. DESCRIPTION
ImgSeek (http://www.imgseek.net/) is an implementation of Haar wavelet decomposition techniques to find similar pictures in a library. This module is port of the ImgSeek library to Perl's XS. It can deal with image objects produced by the "Imager" and "Image::Imlib2" libraries. EXPORT
None by default, but the following functions are available: savedb($file) Dumps the state of the norms and image buckets to the file $file. loaddb($file) Loads a database of image norms produced by savedb cleardb Clears the internal database. Note that "loaddb" will load into memory a bunch of data that you may already have - it will duplicate rather than replace this data, so results will be skewed if you load a database multiple times without clearing it in between. add_image($image, $id) Adds the image object to the database, keyed against the numeric id $id. This will compute the Haar transformation for a 128x128 thumbnail of the image, and then store its norms into a database in memory. remove_id($id) remove id from database, and you should "savedb" to save the changed database. query_id($id[, $results)) This queries the internal database for pictures which are "like" number $id. It returns a list of $results results (by default, 10); a result is an array reference. The first element is the ID of a picture, the second is a score. So for example: query_id(2481, 5) returns, in a shoot I have, the following: [ 2481, -38.3800003528595 ], [ 2480, -37.5519620793145 ], [ 2478, -37.39896965962 ], [ 2479, -37.2777427507208 ], [ 2584, -10.0803730081134 ], [ 2795, -7.89326129961427 ] Notice that the scores go the opposite way to what you might imagine: lower is better. The results come out sorted, and the first result is the thing you queried for. SEE ALSO
http://www.imgseek.net/ AUTHOR
Simon Cozens, <simon@cpan.org> Lilo Huang, <kenwu@cpan.org> All the clever bits were written by Ricardo Niederberger Cabral; I just mangled them to wrap Perl around them. COPYRIGHT AND LICENSE
Copyright (C) 2005 by Simon Cozens, 2008 by Lilo Huang This library is free software; as it is a derivative work of imgseek, this library is distributed under the same terms (GPL) as imgseek. perl v5.14.2 2008-02-09 Image::Seek(3pm)

Check Out this Related Man Page

Prima::ImageDialog(3)					User Contributed Perl Documentation				     Prima::ImageDialog(3)

NAME
Prima::ImageDialog - file open and save dialogs. DESCRIPTION
The module provides dialogs specially adjusted for image loading and saving. Prima::ImageOpenDialog Provides a preview feature, allowing the user to view the image file before loading, and the selection of a frame index for the multi- framed image files. Instead of "execute" call, the load method is used to invoke the dialog and returns the loaded image as a "Prima::Image" object. The loaded object by default contains "{extras}" hash variable set, which contains extra information returned by the loader. See Prima::image-load for more information. SYNOPSIS my $dlg = Prima::ImageOpenDialog-> create; my $img = $dlg-> load; return unless $img; print "$_:$img->{extras}->{$_} " for sort keys %{$img-> {extras}}; Proprties preview BOOLEAN Selects if the preview functionality is active. The user can switch it on and off interactively. Default value: 1 Methods load %PROFILE Executes the dialog, and, if successful, loads the image file and frame selected by the user. Returns the loaded image as a "Prima::Image" object. PROFILE is a hash, passed to "Prima::Image::load" method. In particular, it can be used to disable the default loading of extra information in "{extras}" variable, or to specify a non-default loading option. For example, "{extras}->{className} = 'Prima::Icon'" would return the loaded image as an icon object. See Prima::image-load for more. "load" can report progressive image loading to the caller, and/or to an instance of "Prima::ImageViewer", if desired. If either (or both) "onHeaderReady" and "onDataReady" notifications are specified, these are called from the respective event handlers of the image being loaded ( see "Loading with progress indicator" in Prima::image-load for details). If profile key "progressViewer" is supplied, its value is treated as a "Prima::ImageViewer" instance, and it is used to display image loading progress. See "watch_load_progress" in Prima::ImageViewer. Events HeaderReady IMAGE See "HeaderReady" in Prima::Image. DataReady IMAGE, X, Y, WIDTH, HEIGHT See "DataReady" in Prima::Image. Prima::ImageSaveDialog Provides a save dialog where the user can select image format, the bit depth and other format-specific options. The format-specific options can be set if a dialog for the file format is provided. The standard toolkit dialogs reside under in "Prima::Image" namespace, in Prima/Image subdirectory. For example, "Prima::Image::gif" provides the selection of transparency color, and "Prima::Image::jpeg" the image quality control. If the image passed to the image property contains "{extras}" variable, the data are read and used as the default values. In particular, "{extras}->-{codecID}" field, responsible for the file format, if present, affects the default file format selection. SYNOPSIS my $dlg = Prima::ImageSaveDialog-> create; return unless $dlg-> save( $image ); print "saved as ", $dlg-> fileName, " "; Properties image IMAGE Selects the image to be saved. This property is to be used for the standard invocation of dialog, via "execute". It is not needed when the execution and saving is invoked via save method. Methods save IMAGE, %PROFILE Invokes the dialog, and, if the execution was successful, saves the IMAGE according to the user selection and PROFILE hash. PROFILE is not used for the default options, but is passed directly to "Prima::Image::save" call, possibly overriding selection of the user. Returns 1 in case of success, 0 in case of error. If the error occurs, the user is notified before the method returns. AUTHOR
Dmitry Karasik, <dmitry@karasik.eu.org>. SEE ALSO
Prima, Prima::Window, Prima::codecs, Prima::image-load, Prima::Image, Prima::FileDialog, Prima::ImageViewer, examples/iv.pl. perl v5.14.2 2009-02-24 Prima::ImageDialog(3)
Man Page