The invention discloses a workpiece defect detection method and
system based on sub-pixel features, and relates to the technical field of defect detection.The workpiece defect detection method comprises the steps that a
machine vision device is used for collecting a workpiece image, an edge
contour set of a workpiece is obtained, and the workpiece is divided into edge lines of different categories; the method comprises the following steps: performing
data set division on historical workpiece defect data according to different edge line categories, performing
image segmentation and
morphological processing on defect samples in each historical workpiece defect
data set, obtaining defect areas, performing sub-pixel-level
edge extraction, and analyzing symbolic defect sub-pixel features in defect edges; after a to-be-detected workpiece image is preprocessed, a
region of interest is selected for sub-pixel-level
edge extraction, and the similarity between the sub-pixel-level edge of the
region of interest and the sub-pixel features of the symbolic defect is calculated; and judging defect information of the workpiece according to the similarity. According to the invention, the edge is accurately positioned through sub-pixel-level
edge detection, the detection precision is improved, and high-precision
rapid detection of workpiece quality is realized.