Hough transform is recognized as a powerful tool in shape analysis which gives good results even in the presence of noise and the disconnection of edge. However, traditional Hough transform can only detect the lines, cannot give the endpoints and length of the line segments and it is vulnerable to the quantization errors. Based on the analysis of its limitations, Hough transform has been improved in order to detect line segment feature of targets. The algorithm aims to avoid the loss of spatial information, as well as to eliminate the spurious peaks and fix on the line segments endpoints accurately, which can expediently be used for the description and classification of regular objects. The method consists of 6 steps: 1. setting up the image, parameter and line-segment spaces; 2. quantizing the parameter space; 3. applying the standard Hough transform equation to every point of the input image edge, and extracting a group of maximums according to the global threshold; 4. according to the local threshold, eliminating spurious peaks which are caused by the spreading effects; 5. fixing on the endpoints of the segments according to the dynamic clustering rule; 6. merging the segments whose extreme points are near. Experiment results show the approach not only can recognize regular geometric object but also can extract the segment feature of real targets in complex environment. So the proposed method can be used in the target detection of complicated scenes, and will improve the precision of tracking.