A patterned object that is placed on or adjacent to a display surface of
an interactive display is detected by matching an image produced using
infrared light reflected from the patterned object with one of a set of
templates associated with the patterned object. The templates are created
for each of a plurality of incremental rotations of the patterned object
on a display surface. To implement the comparison, a sum of template data
value corresponding to the intensities of the reflected light is
calculated for the image of the patterned object and for each of the
templates. These sums are compared to determine a rotated template that
matches the patterned object within a predefined threshold, thus
determining that the patterned object has been placed on or near the
display surface.