The invention relates to the technical field of
machine vision, and discloses an enameled wire surface defect detection and classification method based on
machine vision, which comprises the following steps: firstly, collecting a wire scanning image, extracting a single-pixel
time sequence of a fixed transverse position, performing
frequency domain transformation after window
processing, and obtaining a single-pixel
time sequence; determining the position of a main peak according to the power spectrum in a range from
zero frequency to
Nyquist frequency; calculating a spiral
bispectrum locking degree by taking a main peak as a reference; determining a phase sampling resolution according to the locking degree, and performing phase
resampling on a
single pixel time sequence and an adjacent pixel time sequence to generate phase-aligned two-dimensional blocks; then parameterizing
channel gain and channel bias of each layer of the
convolutional neural network by using a spiral
bispectrum locking degree, and inputting a two-dimensional block into the network to obtain a defect probability; a binary
cross entropy loss function is optimized by taking a power function of the spiral
bispectrum locking degree as a
sample weight; the arithmetic mean value of the defect probabilities of the same axial section is obtained, and when the mean value reaches or exceeds a preset threshold value, it is judged that defects exist.