Updated marker detection algorithm.