Image-Leptonica
view release on metacpan or search on metacpan
lib/Image/Leptonica/Func/correlscore.pm view on Meta::CPAN
constraint. However, this is not particularly effective.
The implementation here gives the same result as in
pixCorrelationScoreSimple(), where a temporary Pix is made to hold
the AND and implementation uses rasterop:
pixt = pixCreateTemplate(pix1);
pixRasterop(pixt, idelx, idely, wt, ht, PIX_SRC, pix2, 0, 0);
pixRasterop(pixt, 0, 0, wi, hi, PIX_SRC & PIX_DST, pix1, 0, 0);
pixCountPixels(pixt, &count, tab);
pixDestroy(&pixt);
However, here it is done in a streaming fashion, counting as it goes,
and touching memory exactly once, giving a 3-4x speedup over the
simple implementation. This very fast correlation matcher was
contributed by William Rucklidge.
=head2 pixCorrelationScoreShifted
l_int32 pixCorrelationScoreShifted ( PIX *pix1, PIX *pix2, l_int32 area1, l_int32 area2, l_int32 delx, l_int32 dely, l_int32 *tab, l_float32 *pscore )
pixCorrelationScoreShifted()
( run in 0.685 second using v1.01-cache-2.11-cpan-4d50c553e7e )