The invention relates to a method for detecting surface defects of a dustproof cover of a bearing based on
machine vision, which comprises the following steps: a, obtaining a
gray level image of a to-be-detected bearing; b, carrying out separation on the
gray level image so as to obtain a ring image of the dustproof cover of the bearing; c, carrying out
grey level transformation and adaptive median filtering preprocessing on the ring image; d, carrying out threshold segmentation on the ring image by using a maximum interclass
variance method, extracting an edge of the ring image of the dustproof cover of the bearing after threshold segmentation by using a Roberts
edge detection operator; e, calculating the numbers of which the numerical values are 1 in the
image area every two degrees for the ring image of the dustproof cover of the bearing; f, providing a template bearing image, and obtaining a
deflection angle sigma through calculating; g, carrying out separation on the image so as to obtain character areas and non-character areas of the ring image of the dustproof cover of the bearing; and h, carrying out surface defect judgment on corresponding character areas and non-character areas in the ring image of the dustproof cover of the bearing according to the number of connected areas and the defect area. By using the method disclosed by the invention, automatic detection can be achieved, the
visual detection workload of artificial detection is reduced, the detection efficiency is improved, and the method is safe and reliable.