[SciPy-User] how to interpret scipy.signal.correlate2d
Mon Sep 10 17:00:33 CDT 2012
If you want to find out which _regions_ of images are similar then standard correlation is the wrong tool - it tells you how similar the entire images are at different relative shifts. The simplest test of regional similarity would be to subtract the mean from each image and then multiply them - regions with a high positive value are similar, those with a negative value are different. I suspect that this might work better if you smoothed the product image with a kernel of a size similar to the expected size of matching regions so you get a local average correlation. You might also want to do some form of normalisation if you want to then look at significance, or objectively compare results between different sets of images.
What correlate2d is doing is taking this product, and then taking the sum over all pixels, for all possible relative shifts between the two images.
From: Davide Cittaro <email@example.com>
To: SciPy Users List <firstname.lastname@example.org>
Sent: Tuesday, 11 September 2012 12:42 AM
Subject: [SciPy-User] how to interpret scipy.signal.correlate2d
I would like to correlate two square matrices (same dimensions) with scipy.signal.correlate2d but I have some doubt on interpretation of results. In particular, I have a matrix A=(M, N) and another b=(m, n), when I apply correlate2d(A, b) I obtain a new matrix c=(M+m, N+n). What is the meaning of each element in the new matrix c?
I'm trying to find out which regions of two images are similar.
SciPy-User mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the SciPy-User