The invention discloses a code nail
stamping defect detection method and
system based on
machine vision, and belongs to the technical field of industrial
automation quality control. The method comprises the following steps: acquiring multi-
modal visual data such as a two-dimensional
bright field image, a two-dimensional dark field image and three-dimensional contour data of a to-be-detected code nail; preprocessing the multi-
modal visual data to obtain bright field, dark field and three-dimensional image
data adaptive to a neural
network model; inputting the three kinds of image data into a preset neural
network model for defect identification
processing, and outputting a defect segmentation
mask and defect category information; and finally, performing quantitative analysis on the defects based on the output defect information, and judging whether the product is qualified or not according to an
engineering specification threshold value. According to the method, multi-dimensional and complementary visual information is fused, and a specially designed neural
network model is adopted for analysis, so that the problem of insufficient detection capability of tiny, low-contrast and three-dimensional geometric defects in the prior art can be effectively solved.