Ported most functionality of the dot detector to c++
Merge pull request #6 from Risca/master

Port of DotDetector to C