Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why isn't FFT-based Normalized Cross-Correlation used? #45

Open
zacharynevin-stemcell opened this issue Jan 18, 2024 · 1 comment
Open

Comments

@zacharynevin-stemcell
Copy link

Hi there,

The Matlab documentation has a function called normxcorr2 that does normalized cross-correlation in the FT domain, operating much much faster than normalized cross-correlation without FFT.

As I understand it, the MIST algorithm first does phase-cross correlation and then uses a peak-searching algorithm to find the image offset that corresponds to the maximum NCC.

I'm just curious, especially because I don't have a lot of experience with image analysis, what is the reason that a peak-search algorithm is used instead of something like normxcorr2?

@tblattner
Copy link
Collaborator

There are two stages in the algorithm for MIST. First we find the relative displacements for all neighbors. Then we do a global optimization.

In the first stage we apply normalized cross correlation in the FT domain when finding the candidate regions. In the second stage we calculate stage parameters (or passed in from advanced options) to fine-tune the search space based around the candidate regions. Then we do cross correlations without FFT in a hill-climbing fashion to find the final relative displacement. The search area is much smaller at this point, so we found it unnecessary to operate in the FFT domain at this stage, although it might be worthwhile to analyze the implications here further.

@joechalfoun can add additional insights. I'm not sure if we use the normxcorr2 routine or not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants