According to the characteristics of the PCB solder joint image, we put forward the membership degree's calculation formula of the spatial fuzzy C means(SFCM) algorithm which uses the visual information of the Lab value and the spatial information in the Lab space. The segmentation of the solder joint image and the step of marking the defects are introduced in detail. It is proposed that the solder joint defect degree is calculated by the image segmentation results of the solder joint, and the identification and marking of the defects are carried out according to the value of the defect degree. Experimental results show that the improved algorithm can not only obtain satisfactory image segmentation results, but also obtain more accurate recognition results in the application of the solder joint defect recognition.