Abstract:The magnetic ring surface defects image has low contrast,complex bac kground texture,many kinds of defects,uneven brightness and so on,so a surface defect extraction method of magnetic ring is proposed based on masking technology in this paper.First,the surface defects of magnetic ring are classified into two types through the analysis of the gray difference between different defect regions and normal regions in magnetic surface image. The first one is the difference between the gray value and the normal area,which is easy to segment.The second one is the difference between the gray value of the defect and that of the normal area.Secondly,according to the characteristics of the two kinds of surface defects and the relationship wit h the background,the corresponding defect extraction methods are designed using the masking technology.Finally ,a large number of online experiments are carried out using the developed prototype in different illum ination,sizes,defect types and sizes, etc.Experimental results show that the defect extraction algorithm has good st ability,strong robustness,and can accurately and quickly extract the defects of various regions in a magnetic ring surface image.And the surface defect detection accuracy rate is 95.3%.