Improved marker detection algorithm.