Systems and methods that determine a path of a pen tip as the pen tip is
moved across a document are described. The document is watermarked with a
maze pattern from which encoded position information is determined. A
sequence of images is captured by a camera that is located in a pen. The
path of the pen tip is determined by decoding the associated maze pattern
and by matching the captured images with document images. If the position
coordinates of any frame that is associated with a stroke cannot be
determined from m-array decoding, the frames are transformed and then
matched with an area of a document image. Once the position coordinates
of at least one frame is determined, the position coordinates of other
frames are determined by matching the frames in a neighboring area.