Speed up a image alignment function using FFT

Click For Summary
SUMMARY

The discussion focuses on optimizing an image alignment function using the Fast Fourier Transform (FFT). The provided MATLAB function utilizes FFT to compute the correlation coefficient for image alignment but raises concerns about its efficiency compared to a naive approach. The key takeaway is that while FFT is expected to enhance performance, the implementation may not yield significant speed improvements over simpler methods.

PREREQUISITES
  • Understanding of Fast Fourier Transform (FFT)
  • Familiarity with image processing concepts
  • Proficiency in MATLAB programming
  • Knowledge of correlation coefficients in image alignment
NEXT STEPS
  • Explore advanced FFT techniques for image processing
  • Learn about optimizing MATLAB code for performance
  • Investigate alternative image alignment algorithms
  • Study the impact of circular shifting on FFT performance
USEFUL FOR

Image processing engineers, MATLAB developers, and anyone involved in optimizing image alignment functions using FFT techniques.

CNX
Messages
26
Reaction score
0

Homework Statement



I need to speed up a image alignment function using FFT

Homework Equations



FFT, correlation coefficient (for deciding best alignment)

The Attempt at a Solution



This function works but a fail to see how it is any better that a naive evaluation of the correlation coefficient.

Code:
function [a, b] = Align(f, g)

    [h, w] = size(f);
    
    a = 0;
    b = 0;
    cmax = 0;
    
    G = fft2(g);
    G = conj(G);
    
    for j=1:h-1
        for k=1:w-1
            fs = circshift(f, [j,k]);
            F = fft2(fs);

            c = sum(F(:).*G(:));
            
            if c > cmax
                cmax = c;
                a = j;
                b = k;
            end
        end
    end
    
    return
 
Physics news on Phys.org


i thought fft was fast Fourier transform
 

Similar threads

  • · Replies 4 ·
Replies
4
Views
3K
Replies
2
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 21 ·
Replies
21
Views
2K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 1 ·
Replies
1
Views
1K
Replies
6
Views
2K
Replies
26
Views
6K