Detection and tracking of hands from visual information is a key issue for gesture recognition. Based on Near Infrared (NIR) imagery we present a new procedure for hand detection. The sensor we propose is a single NIR camera with an attached NIR light source and a visible light filter, which makes our system invariant under changing environments and uncontrolled lighting conditions. The main contributions are twofold. On the one hand we propose a new shape descriptor composed of inner-angles and inner-distances. On the other hand, our novel parametrization of the extracted descriptor allows for elastic hand contour matching. The proposal is validated experimentally and tested with the standard data set MPEG-7.