Image magick's compare is very good with this type of works if you have images
In reply to Re: Can Perl do 2D matching? by pvaldes in thread Can Perl do 2D matching? by songlinl