in reply to Image processing in perl

Image::Match seems to do what you are asking for, though you would probably need to first convert your bmp's to gif format.


Dave

Replies are listed 'Best First'.
Re^2: Image processing in perl
by Corion (Patriarch) on Feb 02, 2011 at 09:50 UTC

    As an alternative, Imager::Search, which uses Imager. I've not tried either module, so I don't know which is better...

Re^2: Image processing in perl
by viplav4u1ly (Initiate) on Feb 02, 2011 at 09:45 UTC
    Hi , i am not able to install Image::Match in my system due to some dependencies. like only makefile.pl is present no intaller is present for active perl. Please help me out in installetion process."
Re^2: Image processing in perl
by viplav4u1ly (Initiate) on Feb 03, 2011 at 07:10 UTC
    Hi, thanks for the suggestion. I installed the Image::Match package. As i told, i have two images, sample image and reference image. there are total 30 occurance of reference image in sample image, but theprogram is giving only one occurence. like "found at 3:424" coordinate.it should give the output for all 30 (x,y) coordinate. the program is given bellow:
    use Image::Match; $sample = Prima::Image-> load('im1.gif') or die "Can't load: $@"; $reference = Prima::Image-> load('im2.gif') or die "Can't load: $@"; # find again $OPTIONS{multiple} = 1 ; my ( $x, $y) = $sample-> match( $reference); $OPTIONS{overlap} = all ; print defined($x) ? "found at $x:$y\n" : "not found\n"; print "$x $y";
    I am not able to find theway to do the same. Please anyone suggest me how to get the desired output.

      You should use strict;. Had you done so you would realize that %OPTIONS doesn't exist, which is a clue that your expectation that $OPTIONS{multiple} = 1; is doing something is wrong.

      The POD for that module is simply awful. However, I think if you alter your match() call as follows, you'll have better luck:

      my( @matches ) = $sample->match($reference, {multiple => 1});

      You should find @matches to now be populated with an array of arrays representing the XY coordinates of each match.

      Whoever wrote that POD should be shot though (with a water pistol, of course). I would have to read the module's actual code to be sure that my suggestion even fits.


      Dave

        hi Dave, I tried this one but still same problem. it is showing the o/p only for one occurance. please give me the suitable solution to this problem.