A two-stage high-precision algorithm for detecting the orientation and position of the surface mount device (SMD) is described. In the preprocessing step, a coarse orientation of the SMD is obtained by line fitting. A high-precision fuzzy Hough transform (FHT) is applied to the corner points to estimate precisely the orientation of the device, with its position determined by using four detected corner points. The FHT employed has a real-valued accumulator over the limited range of angles that is determined in the preprocessing step. Computer simulation with a number of test images shows that the parameters obtained by the presented algorithm are more accurate than those by conventional methods such as the moment method, projection method, and Hough transform methods. It can be applied to fast and accurate automatic inspection and placement systems.