As a kind of bearing component,universal joint is an important part of automobile power transmission device.In order to ensure the delivery quality of the universal joint workpiece,the workpiece needs to be inspected for defects during the production process.The magnetic particle inspection method is commonly used in the industry to detect the surface defects of the universal joint workpiece.However,the traditional manual inspection has low efficiency and poor stability,and the working environment is harmful to human health.In response to these problems,this paper designs a magnetic particle inspection system for bearing parts based on machine vision to replace human eyes to detect surface defects of universal joints.In view of the characteristics of the surface defects of the universal joint,the system adopts an image processing-based inner wall defect detection algorithm and an outer wall detection algorithm based on deep learning to detect different parts of the universal joint.The inner wall defect detection algorithm based on image processing is mainly divided into three parts: image preprocessing,extraction of regions of interest,and image segmentation: using adaptive median filter algorithm to reduce image noise;using an improved Canny edge detection algorithm to extract images The region of interest;the adaptive threshold method is adopted for the region of interest to obtain the binarized image of the defect and the background.Due to the small scale of the outer wall image samples,most of the current deep learning-based surface defect detection algorithms are implemented by target detection and semantic segmentation.However,these target detection and semantic segmentation networks require larger data drive,and the detection effect is when the defect sample data set is small.Bad.Therefore,this paper designs a two-stage deep learning network based on UNET and ResNet to detect the outer wall defects of bearing components,which performs well when the data set is small.In the first stage,the image of the outer wall of the bearing component is roughly segmented to extract the possible defects in the image,and the second stage is to classify the extracted defects.The entire system adopts a distributed microservice architecture,which mainly includes a defect detection module,a user authority management module,a device management module,and a data management module.The defect detection module deploys the defect detection algorithm in the form of a Flask server,and communicates with the hardware system through the HTTP protocol to realize the full automation of magnetic particle detection.User authority management,equipment management,and data management respond to the trend of intelligent manufacturing to realize the visualization of the inspection process and the remote control of equipment.Experimental tests show that the system can run stably for a long time,and can still provide external services after a single module is down.The algorithm detection rate reaches 99.3%,and the detection speed is 1.7 seconds.The system can fully meet the relevant detection requirements on the actual production line. |