A position of a three-dimensional (3D) object relative to a display
surface of an interactive display system is detected based upon the
intensity of infrared (IR) light reflected from the object and received
by an IR video camera disposed under the display surface. As the object
approaches the display surface, a "hover" connected component is defined
by pixels in the image produced by the IR video camera that have an
intensity greater than a predefined hover threshold and are immediately
adjacent to another pixel also having an intensity greater than the hover
threshold. When the object contacts the display surface, a "touch"
connected component is defined by pixels in the image having an intensity
greater than a touch threshold, which is greater than the hover
threshold. Connected components determined for an object at different
heights above the surface are associated with a common label if their
bounding areas overlap.