This paper proposes a machine vision based solder pad detection method to improve the detection accuracy and efficiency of PCB solder pad defects in electronic components due to missed detection and low detection efficiency. Firstly, preprocess the electronic component pad images collected by the visual system, then use threshold segmentation method to perform preliminary segmentation of the pad images. Then, the coarse segmented images are finely segmented using mean clustering method, and the fine segmented images are pixel edge extracted. Finally, the matrix subpixel edge detection method is used to improve the edge detection accuracy. Simulation experiments have shown that the proposed method can significantly improve the accuracy and speed of defect recognition.