Useful for unwrapping small images, but not for large images. A 510x510 array took 25 minutes on my machine. The following improvements need to be made for larger arrays:
1. Implement the "postponed" list described in Ghiglia and Pritt.
2. Avoid using Matlab's unwrap() function for unwrapping a length-two vector. Instead use Itoh's Method for a length 2 vector explicitly:
D = psi(2)-psi(1);
delta = atan2(sin(D),cos(D);
phi = psi(1) + delta;
3. Resize matrices as vectors
This yields about 20X speed improvement for the 510x510 array size.