The invention relates to the technical field of industrial vision, in particular to an automobile part surface defect detection method and
system based on
machine vision, and the method comprises the steps: firstly loading a CAD three-dimensional model, and rendering an ideal fringe reflection map in a virtual environment; calculating an
optical distortion correction matrix by comparing the
phase distortion with the
phase distortion of an actual initial reflection image, driving a programmable
light source to project a compensation pattern, and generating a normalized reflection intensity image;
signal object decoupling is achieved through multi-scale
wavelet transform, and high-frequency components and low-frequency components are separated;
homomorphic filtering is applied to the low-frequency component to construct a homogenized background model, the high-frequency component is reversely corrected, and a high-
signal-to-
noise-ratio defect
signal image is output; generating a coarse segmentation
mask by the high-frequency signal through an adaptive local threshold, generating a morphology anomaly
mask by the low-frequency signal through Hessian matrix
morphological analysis, and fusing to form a collaborative segmentation
mask; and extracting multi-dimensional geometric attributes of connected domains in the masks, and inputting the multi-dimensional geometric attributes into a
decision tree to realize accurate classification and confidence output of defects.