With the development of intelligent industrial production, industrial components with linear structure tend to be regular, such as TV LCD module, mobile phone screen, and electronic equipment shell. Recognition of linear structure objects by machine vision is an important aspect of intelligent industry. At present, shape matching algorithm is mostly used for arbitrary structure objects. It will be time-consuming if it is directly used to detect the linear structure objects as it needs to traverse the parameter space of the object. To solve the traversal problem and detect the linear structure objects in real time, a heuristic detection algorithm is designed according to the characteristics of linear structure objects. First, the coarse position and orientation are obtained by mean shift filtering and heuristic region grouping to reduce the searching range. Then, the heuristic search method is used to get the precise location information. The heuristic search method is designed based on the particle swarm optimization algorithm and heuristic information. The proposed method has been evaluated on two image databases of common industrial parts and backlight units which are typical linear structure objects. The experimental results showed that the proposed algorithm could reduce the detect time by more than 70% averagely while the detection accuracy is kept. It proves that the proposed algorithm can detect linear structure objects in real time and is suitable for the detection of objects with linear structures.