Saturday, June 30, 2012

Week #6

 This week I passed my exams and finally I'm able to spend more time on project. I think that on next week I'll make progress and write a real code (not for testing purposes).

But today I'm stuck. I solved problem with singular matrix using approximate computation (least squares method from numpy = lstsq (http://docs.scipy.org/doc/numpy/reference/generated/numpy.linalg.lstsq.html)), but my implementation of LMA method converges very poorly. I fixed some errors and tried to tune parameters, but it wasn't successful. In some cases, I get admissible results (mosaic is good and time of solving is small), in others algorithm stuck and can't overcome strange minimum. I didn't figure out why it happens.
So, previous oprimization based on Gradient descent algorithm looks better, and if I can't apply LMA, I'll try gradient. But I really hope to solve my problems with LMA.

I corrected my code and tuned parameters, all links from my weekly report #5.

Brief results:
1 picture - LMA,  error:
before - 20516, after - 4669 and requires only one (!) iteration (its'really fast!)
I got also error about 4161 with 43 iterations (then algoritm totally converges) 



2 picture - also LMA, but here, as you can see, algorithm fails (despite of number of iterations or values of thresholds, method stucks)



Interesting results with non aerial photos

LMA method (the best mosaic as I could get)




The same photos, but Gradient descent algorithm (it looks much better than previous with LMA)
It's all for this week!

Friday, June 22, 2012

Week #5

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
https://github.com/migal-drew/OpencvTransform/blob/master/src/mosaicing_lma.py
Main LMA code
https://github.com/migal-drew/OpencvTransform/blob/master/src/levenberg_marquardt.py
And I made some minor changes in
https://github.com/migal-drew/OpencvTransform/blob/master/src/utilities.py

Saturday, June 16, 2012

Week #4

This week was unsuccessful because of my university exams and I was unable to follow my shedule.
I only started to figure out how SURF algorithm works, and I'm planning to understand Levenberg-Marquardt method. Also I'll try gdalwarp and/or gdaltransform utilities and decide will it be useful or not. It looks like my project is frozen, but I hope to catch up.

Tuesday, June 12, 2012

Previous similar approach

Recently I've discovered this paper http://www.gmat.unsw.edu.au/snap/publications/xing_etal2010c.pdf
The main algorithm and crucial parts of mosaicing process described here almost exactly match with my ideas. Of course proposed in this publication method is much more sophisticated and includes additional optimization steps as applying of Kalman filter and Levenberg-Marquardt algorithm. But thr main idea is the same - matching corresponding points and minimization of square function.

Saturday, June 9, 2012

Week #3

I have exams in my university, so I didn't make any sufficient progress in  GSoC work. Probably I'll spent another week on my study. But my current goals stay the same and I hope to return to project soon as I'll have any free time.

Saturday, June 2, 2012

Week #2

It was a busy week, so I didn't reach my goal to get more familiar with algorithm of searching feature points, but I have some new ideas.
Feature searching algorithms are versatile and they can give diverse results on photos. Some methods detect more points than others on the one photo, and a little amount of points on another. It happens due to quality of the landscape and number of well-marked objects as single trees and buildings. That's why we need to select the most stable and robust algorithm which can provide enough points in almost all cases.
FAST Corner Detector algorithm is extemely speedy and simple, but SURF is more robust and tends to search more points. I think that it would be interesting to compare these and others algorithms and pick the best. Today many feature searching approaches exist and they are being developed and improved, so I need to briefly investigate their advantages and disadvantages.
I think that the primary task is to enhance optimization and try a Levenberg-Marquardt method. I hope that the stitching process will work significantly faster.
http://en.wikipedia.org/wiki/Levenberg-Marquardt_algorithm