matejak / imreg_dft

Image registration using discrete Fourier transform.
Other
245 stars 68 forks source link

Fix compute similarity matrix. #46

Closed GCBallesteros closed 1 year ago

GCBallesteros commented 2 years ago

I needed to map pixel indices in the source image to pixel indices on the transformed image and needed the similarity_matrix function to be working for this.

GCBallesteros commented 1 year ago

The calculation shown here is actually wrong because the image transformation routine used does some reshaping and back of the input that messes things up. I have found a better way that parametrizes the transformation using directly a single affine transformation matrix instead of 3 sequential transformations (scale -> rot -> translation). This is both faster and less ambiguous as the output of the algo is just a homography matrix.

If there is interest for such a PR I'm more than happy to prepare it. It only requires changes to the transform_img function. In the meantime I will have my own simplified fork of the repo.