The high-precision inspection and alignment algorithms of surface mounting devices (SMDs) using fuzzy morphology are proposed. After camera calibration is performed, the proposed inspection algorithm detects SMD lead defects such as bending and breaking using the ruler generated by fuzzy morphology. The SMD having no defects is tested to determine whether or not it is mounted correctly in the specified position. The proposed alignment algorithm accurately computes orientation and position using subpixel interpolation. It consists of two parts: the preprocessing and main processing parts, in which corner points and coarse orientation of an SMD are detected and interpolation is used to obtain final parameters with subpixel accuracy. The computer simulation with several sets of test images shows that the proposed algorithms give accurate parameters, and they can be applied to fast and accurate automatic surface mounting systems.