Imager::Search - Locate an image inside another image
# Create the search my $search = Imager::Search::RRBBGG->new( big => $large_imager_object, small => $small_imager_object, ); # Run the search my $found = $search->find_first; # Handle the result print "Found at row " . $found->top . " and column " . $found->left;
THIS MODULE IS CONSIDERED EXPERIMENTAL AND SUBJECT TO CHANGE
This module is designed to solve a conceptually simple problem.
Given two images (we'll call them Big and Small), where Small is contained within Big zero or more times, determine the pixel locations of Small within Big.
For example, given a screen shot or a rendered webpage, locate the position of a known icon or picture within the larger image.
The intent is to provide functionality for use in various testing scenarios, or desktop gui automation, and so on.
my $search = Imager::Search::RRBBGG->new( big => $large_imager_object, small => $small_imager_object, );
The new constructor takes a new search object.
new
It takes two parameters by by default, for clarity simply named big and small. Both should be Imager objects.
big
small
The small param is the image you are searching for, and the big param is the image you will be searching in.
Returns a new Imager::Search object, or croaks on error.
The big accessor returns the original big Imager object.
The small accessor returns the original small Imager object.
The find_first method is the only one implemented in this first release of Imager::Search.
find_first
It compiles the search and target images in memory, and executes a single search, returning the position of the first match as a Imager::Search::Match object.
No support is available for this module
Adam Kennedy <adamk@cpan.org>
Copyright 2007 Adam Kennedy.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
The full text of the license can be found in the LICENSE file included with this module.
To install Imager::Search, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Imager::Search
CPAN shell
perl -MCPAN -e shell install Imager::Search
For more information on module installation, please visit the detailed CPAN module installation guide.