While your question deals with software for photographic subjects, it seems more like a software question than a photography question since you're asking about the computational algorithms which could be used. You'd probably find more helpful resources by posting your question on StackOverflow.com which is filled with software developers.
- Aaron B. Hockley