On this week I tried to implement Levenberg-Marquardt algorithm (LMA http://en.wikipedia.org/wiki/Levenberg-Marquardt_algorithm), but I encountered some problems. The Hessian matrix, which I've computed, is non-invertible (singular), so method doesn't work.
Therefore I should find another solution or modify algorithm.
This code finds feature points and invokes LMA
Main LMA code
And I made some minor changes in