The invention relates to an auto part defect recognition method based on similarity match. The method has functions of detecting a leakage
welding point, a leakage small part, a leakage nut and a leakage
punching hole on the auto parts, and the detection objects are a
welding point, a small part, a nut and a
punching hole. The method comprises realization steps: firstly, an auto part image is acquired, and whether a
template library needs to be built is judged; then, a detection area is captured on the acquired image, and image preprocessing is carried out on the area; then, template images ina detection object
template library are traversed, the template images and the image after pre-
processing are subjected to scanning and similarity contrast, a contrast result is saved to a cue map, and all information of the detection objects is included in the cue map; and finally, contour detection
processing is carried out on the cue map, a contour perimeter, a roundness and an area are used to select a detection object, the contour number and position information is acquired, and whether defects of a leakage
welding point, a leakage small part, a leakage nut or a leakage
punching hole exist on the auto part in the acquired image can be detected.