Skip to content

use of wavelet in spatial matching #52

@cristianlussana

Description

@cristianlussana

The spatial matching could probably be done by exploiting a bit more of the wavelet properties. In particular, instead of finding the match by comparing the de-composed coarse fields (i.e. averages over large boxes) -as I firstly suggested, not the smartest thing to do but the easiest- it might be better to compare the wavelet coefficients of the coarser scales.
What we gain is a match that takes into account much more spatial details than before and this might help in the matching of two "rare" situations.

In practice, the command we are using now is (file database.py):
dec = pywt.wavedec2(data, 'haar', level=self.wavelet_levels, axes=(1, 2))[0]
man page is:
http://pywavelets.readthedocs.io/en/latest/ref/2d-dwt-and-idwt.html
search for"pywt.wavedec2":
the function returns a list:
[cAn, (cHn, cVn, cDn), ... (cH1, cV1, cD1)]
and now we are using cAn, instead I'm suggesting to use all the other elements. The quality of the match between two fields is the (scalar) value given by the summation of all the squared differences:
[cHn(field1)-cHn(field2)]^2 + [cVn(field1)-cVn(field2)]^2+[cDn(field1)-cDn(field2)]^2 + ... + [cH1(field1)-cH1(field2)]^2 + [cV1(field1)-cV1(field2)]^2+[cD1(field1)-cD1(field2)]^2
Note that: the dimension of the vectors cHn, cVn, cDn is different from the one of the vectors cH(n-1),cV(n-1),cD(n-1) because they refers to different grids; and cH1, cV1, cD1 should be just 3 scalar values.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions