Gait measurement is important in various applications such as monitoring systems for the elderly. This paper presents a gait measurement system applicable to the elderly using a laser range sensor (LRS). An LRS can obtain high accuracy distance data over a wide range and leg position can be calculated based on characteristic leg patterns from the scan data. However, situations in which a leg is hidden from the LRS or both legs are too close together lead to false tracking or losing track of both legs entirely. In the case of the elderly in particular, these situations are likely to occur due to slow movement or narrow stride. To solve these problems, we present a novel leg detection method with five observed leg patterns and global nearest neighbor (GNN)-based data association, using a variable gate based on the state of each leg. Experimental results of several elderly people show that the proposed system can reduce the chances of both false tracking and losing track of both legs, and can acquire the accurate trajectory of both legs.