This is accomplished by thresholding the gradient and taking advantage of the color of the previous edge of the tracked tip.
Finding the location of the pointer tip can be expedited by a re-initialization technique that employs a background subtraction technique.