Watch this Author's files
The program is good. But computationally intensive.
The function 'normxcorr2' available in matlab is faster than the code you submitted. Please profile it and see for yourself. But thanks for sharing the code.
Very good ellipse function.
Contact us at files@mathworks.com