원시데이터 수집 시스템
선정목록으로

Magnetic Ring Multi-Defect Stereo Detection System Based on Multi-Camera Vision Technology

간접 관련 화학·수지 · (21) 에폭시수지 (14) 드라이 필름(포토레지스트)(15) 디스플레이 패널재료

기본 정보

저자
  1. Xinman Zhang — School of Electronics and Information Engineering MOE Key Lab for Intelligent Networks and Network Security, Xi'an Jiaotong University, Xi'an 710049, China
  2. Weiyong Gong — School of Electronics and Information Engineering MOE Key Lab for Intelligent Networks and Network Security, Xi'an Jiaotong University, Xi'an 710049, China
  3. Xuebin Xu — Guangdong Xi'an Jiaotong University Academy, Foshan 528000, China
DOI
10.3390/s20020392
저널
Sensors
발행년도
2020
발행기관
Multidisciplinary Digital Publishing Institute
피인용수
11
라이선스
cc-by
논문 유형
–
언어
–
원문 페이지
https://doi.org/10.3390/s20020392
토픽
Surface Roughness and Optical Measurements
OpenAlex ID
W2998888794

평가 내용

관련도
간접 관련
사업분야
화학·수지 · (21) 에폭시수지
부 분야
(14) 드라이 필름(포토레지스트), (15) 디스플레이 패널재료
R&D 측면
분석·모델링
확신도
0.70
근거 용어
defect detection, vision technology, image processing, surface inspection, automated inspection
판단 근거
본 논문은 자기 링(Magnetic Ring)의 표면 결함을 머신 비전 기술로 검출하는 시스템에 관한 연구입니다. 코오롱인더스트리의 직접적인 제품은 아니나, 필름이나 전자재료(PCB 등) 제조 공정에서 필수적인 자동화 외관 검사(AOI) 및 품질 관리 알고리즘 기술로 응용 가능합니다.
R&D 활용 포인트
전자재료 및 필름 제조 공정 내 실시간 결함 검출(Crack, 이물질, 표면 불량 등)을 위한 머신 비전 시스템 및 이미지 처리 알고리즘 고도화에 활용 가능합니다.
평가 입력
본문 46,441자 중 30,032자 발췌

초록

Magnetic rings are the most widely used magnetic material product in industry. The existing manual defect detection method for magnetic rings has high cost, low efficiency and low precision. To address this issue, a magnetic ring multi-defect stereo detection system based on multi-camera vision technology is developed to complete the automatic inspection of magnetic rings. The system can detect surface defects and measure ring height simultaneously. Two image processing algorithms are proposed, namely, the image edge removal algorithm (IERA) and magnetic ring location algorithm (MRLA), separately. On the basis of these two algorithms, connected domain filtering methods for crack, fiber and large-area defects are established to complete defect inspection. This system achieves a recognition rate of 100% for defects such as crack, adhesion, hanger adhesion and pitting. Furthermore, the recognition rate for fiber and foreign matter defects attains 92.5% and 91.5%, respectively. The detection speed exceeds 120 magnetic rings per minutes, and the precision is within 0.05 mm. Both precision and speed meet the requirements of real-time quality inspection in actual production.

본문 46,441자

본문 펼치기
# _sensors_ _Article_ ## Magnetic Ring Multi-Defect Stereo Detection System Based on Multi-Camera Vision Technology † Xinman Zhang <sup>1</sup> , Weiyong Gong <sup>1,</sup> * and Xuebin Xu <sup>2</sup> 1 School of Electronics and Information Engineering MOE Key Lab for Intelligent Networks and Network Security, Xi’an Jiaotong University, Xi’an 710049, China; zhangxinman@mail.xjtu.edu.cn 2 Guangdong Xi’an Jiaotong University Academy, Foshan 528000, China; ccp9999@126.com * Correspondence: gong_w_y@stu.xjtu.edu.cn - This paper is an extension version of the conference paper: Zhang, X.; Gong, W.; Feng, H.; Xu, X. Magnetic Ring Detection System Based on Multi-Camera Vision Technology. In Proceedings of the 2018 IEEE 4th International Conference on Computer and Communications (ICCC), Chengdu, China, 7–10 December 2018. Received: 20 November 2019; Accepted: 8 January 2020; Published: 10 January 2020 [���������](http://www.mdpi.com/1424-8220/20/2/392?type=check_update&version=1) [�������](http://www.mdpi.com/1424-8220/20/2/392?type=check_update&version=1) Abstract: Magnetic rings are the most widely used magnetic material product in industry. The existing manual defect detection method for magnetic rings has high cost, low efficiency and low precision. To address this issue, a magnetic ring multi-defect stereo detection system based on multi-camera vision technology is developed to complete the automatic inspection of magnetic rings. The system can detect surface defects and measure ring height simultaneously. Two image processing algorithms are proposed, namely, the image edge removal algorithm (IERA) and magnetic ring location algorithm (MRLA), separately. On the basis of these two algorithms, connected domain filtering methods for crack, fiber and large-area defects are established to complete defect inspection. This system achieves a recognition rate of 100% for defects such as crack, adhesion, hanger adhesion and pitting. Furthermore, the recognition rate for fiber and foreign matter defects attains 92.5% and 91.5%, respectively. The detection speed exceeds 120 magnetic rings per minutes, and the precision is within 0.05 mm. Both precision and speed meet the requirements of real-time quality inspection in actual production. Keywords: multi-camera vision technology; magnetic ring defect detection; stereoscopic inspection; image processing 1. Introduction Magnetic materials are commonly used in electronic circuits as anti-interference components. As the main product, magnetic rings are widely used in aerospace, military electronics, automobiles, sensors, the petrochemical industry, magnetic drives and other fields [1]. During the production process, due to the production environment and processing procedures, defects, such as crack, adhesion, pitting, foreign matter and fiber defects, will appear on the surface of the magnetic ring. These defects would affect the appearance and performance of industrial products. Therefore, high-efficiency and high-precision surface detection of magnetic rings is crucial for manufacturing enterprises. However, surface defect detection and height measurement of magnetic rings by manual inspection, which is currently widely used, are costly, inefficient, low-speed and low-accuracy. Hence, it is significant to design an automated system to complete real-time defect detection and height measurement for magnetic rings. In recent years, many excellent technical solutions for defect detection have been proposed by researchers. The ultrasonic testing technique [2,3], eddy current testing technique [4–6] and vision inspection technique [7–10] are widely used. Among them, in practical production, the vision _Sensors_ 2020, _20_ [, 392; doi:10.3390/s20020392](http://dx.doi.org/10.3390/s20020392) [www.mdpi.com/journal/sensors](http://www.mdpi.com/journal/sensors) _Sensors_ 2020, _20_, 392 2 of 17 inspection technique has been successfully adopted for surface detection of industrial products because of its convenience, effectiveness and cost performance. Li and Ren [11] developed an intelligent vision detection system for discrete rail surface defects. Tsai and Hsieh [12] proposed a fast image alignment method by using the expectation-maximization (E-M) technique, which accomplished the positioning and defect inspection of printed circuit boards (PCBs). Furthermore, an entropy-rate clustering algorithm combined with prior shape constraint was proposed by Chen [13] to detect defects and deformations across an imaged can-end surface. Ko and Rheem [14] inspected the surface defects of solar wafers by using the local binarization method. Furthermore, aimed at the inspection of magnetic ring surfaces, researchers have carried out active research. By using the ultrasonic testing technique, Xu [15] designed a programmable filter based on the MAX262 chip, and used the fourth-order Chebyshev bandpass filter to extract weak vibration signals for detecting cracks in the magnetic ring. However, the detection of defects other than cracks was not considered. Using the vision inspection technique, Yu [16] designed an automatic vision-based detection system and used an improved BHPF (butterworth high pass filter) filter for denoising. Nevertheless, the designed system only completed the detection of the magnetic ring end face, which is not comprehensive. Furthermore, Li and Zhang [17] proposed a surface defect extraction method for magnetic rings based on the adaptive Canny algorithm of the edge-detection method and masking technology. However, the detection of the inner torus was not considered. To measure the multiple dimensions of magnetic rings quickly and to detect and classify the defects precisely, this paper develops a magnetic ring intelligent detection system based on multi-camera vision technology. A wide range of aspects is considered to ensure that no defect or surface is missing, making our system more comprehensive than the systems mentioned above. Trapped by multiple tasks and diverse defects, the traditional single vision system cannot obtain enough information. So, multiple vision machines are used in the system, which guarantees high-speed defect detection on multiple surfaces of three-dimensional magnetic rings. Two image processing algorithms are proposed, namely, the image edge removal algorithm (IERA) and magnetic ring location algorithm (MRLA), respectively, which effectively solve the defect segmentation problem. Finally, by using reasonable thresholds obtained through experiments, connected domain filtering methods are indicated to localize defects quickly and accurately. The rest of this paper is organized as follows. Section 2 describes the hardware and software components of the multi-vision machine intelligent detection system; Section 3 describes the defect detection algorithm for each surface and the height measurement method; Section 4 demonstrates the detection results of the system. Finally, the conclusions are given in Section 5. 2. System Design _2.1._ _Hardware Design_ As can be seen from Figure 1, the outer diameter and inner diameter of the magnetic ring to be tested are 22 and 20 mm. The height is 3.5 mm, and the color is gray. The structure is complicated and the types of defects are various, so how to realize the real-time online detection of all defects and surfaces is a difficult problem. One approach is using a single vision machine and rotational shooting mode, but this demands a high-precision rotary positioning system and the detect speed is too low to meet the requirements. Considering the fact that defects are distributed on all sides of the magnetic ring, we propose a solution that can complete image acquisition and processing synchronously by using multiple high-speed vision machines. This system mainly includes three modules, which are the visual inspection module, actuator module and host computer module (as shown in Figure 2). The visual inspection module contains six vision machines and achieves multi-view image collection, image processing and test results sending. The vision machine integrates camera control, card processing and serial communication to solve industrial automation production problems [18]. The host computer takes charge of the judgment _Sensors_ 2020, _20_, 392 3 of 17 results summary of all the vision machines and the control of the executing mechanism. The actuator module, consisting of a feeding device, a transmission device and a sorting device, completes the mechanical operation of the magnetic ring. The feeding device is responsible for feeding magnetic rings into the transmission device at a certain speed. The transmission device is in charge of transmitting magnetic rings from the feeding device to the sorting device. The sorting device finishes final defect classification according to the control signal of the host computer. ~~1mm~~ Inner diameter:20mm Height:3.5mm Figure 1. Physical image of the magnetic ring. Control <u>signal</u> Camera Image <u>signal</u> Industry personal computer Image <u>signal</u> Industry personal computer Camera Image <u>signal</u> Camera Camera trigger Locating signal signal of magnetic ring Visual machine Result decision <u>signal</u> Host computer Camera trigger Image <u>signal</u> Camera signal Visual machine Group vision machine Figure 2. Structural diagram of the magnetic ring detection system. Feeding device Transmission device Sorting device Actuator Relying on the elaborate design, the actuator could successfully realize non-destructive detection. The vibrating feeding plate is used as the feeding device, whose vibration frequency is adjustable to ensure uniform feeding speed and avoid secondary damage. Meanwhile, since both the upper and lower end faces need to be detected, a glass turntable is employed as the driving device. In this way, by setting cameras and light sources above or below the glass disk, images are taken without flipping the mag ~~netic~~ ring. Furthermore, ~~a sol~~ enoid valve is used as the sorting device to ensure the response speed and mechanical force. Ultimately, there will be no secondary damage to the magnetic ring. Besides, the hardware of the system has hi ~~gh expansi~~ bility and ~~can be adj~~ usted according to the actual requirements. Benefitting from multiple vision machines, this system has a high processing speed and a wide range of perspectives, which can deal with three-dimensional part detection problems. Nevertheless, with the use of multiple vision machines, the cost of the system is not that inexpensive. Furthermore, there are many components in the hardware system, so the complexity of the device brings some difficulties to the later management. Figure 3 shows the prototype of this multi-vision magnetic ring quality inspection system. To further illustrate the hardware system, a simplified diagram of the entire system is drawn, as shown in Figure 4. First, magnetic rings are fed into the system through the vibrating feeding plate. Then, it reaches the camera shooting point after adjusting the position and completing the counting. Subsequently, this system uses two stations to photograph the magnetic ring and detect defects. Station 1 contains a binocular vision machine and two cameras. These two cameras are responsible for measuring the height and detecting the lower end face. Station 2 consists of five vision machines with a total of nine cameras. Due to the inner and outer toruses of the magnetic ring being curved surfaces, the view of a single camera cannot cover all toruses. So, among them, four cameras are responsible for taking pictures of the outer surface, and four cameras are responsible for taking pictures of the _Sensors_ 2020, _20_, 392 4 of 17 inner surface. The last camera with a vertical view is located on the platform to detect the upper end face. After taking the picture, vision machines receive the image and perform defect detection. Then, all detection results are sent to the host computer. Finally, when the magnetic ring reaches the sorting device, the qualified and unqualified magnetic rings are separated. ( a ) ( b ) ( c ) ( d ) ( e ) ( f ) Figure 3. The prototype of the magnetic ring detection system: ( a ) system appearance; ( b ) feeding device; ( c ) precision turntable and slide rail limit device; ( d ) group vision machine and light source; ( e ) sorting device; ( f ) host computer and console. _2.2._ _Software Design_ Based on the system hardware, the software of the proposed system is developed on the MFC and OpenCV platforms. If any defect is found, the software will mark and output the defect’s height measurement results. It includes four modules, which are the camera control module, interactive interface module, magnetic ring defect detection module, and detection result communication and storage module. The camera control module mainly performs tasks such as camera control, camera status feedback, camera parameter setting, camera mode selection, image storage buffering and release. The interactive interface module is in charge of the interaction between the user and the system, including the camera control area, real-time image display area, result display area, threshold selection area and magnetic ring-type selection area. The defect detection module integrates all the methods proposed in the paper and takes charge of real-time detection and marking of images. The detection result communication and storage module adopts the serial communication mode and completes the transmission task of the defect detection result from the vision machine to the upper computer. _Sensors_ 2020, _20_, 392 5 of 17 The software runs on six visual machines. The interactive interface and defect detection modules of different visual machines are adjusted according to the installation position of the camera, the number of cameras and the characteristics of the magnetic ring image. However, the software framework and operating procedures are the same for each machine. The flow chart of software operation is shown in Figure 5, and the interactive interface can be seen in Figure 6. Feeding Device <u>Switch Signal</u> <u>NG Product Blowing Signal</u> <u>OK Product Blowing Signal</u> Loading Plate Limiter <u>Turntable</u> <u>Magnetic Ring Position Trigger Signal</u> <u>Lower Camera Trigger Signal</u> <u>Height Measurement Camera Trigger Signal</u> Camera Trigger Signal Sorting Device Station 2 Station 1 Infrared Sensor Industrial Network Camera for Upper End-face Camera for Inner Torus and Outer Torus Light Source The ring Camera for Height Measurement Camera for Lower End-face Serial Network Control Port Port Port Control Board Motherboard Host Computer Results Industrial Serial Network Control Port Port Network Port Control Board Vision Machines Figure 4. Total plan of the magnetic ring defect detection system. No Start Dongle detection? Yes Set camera parameters Turn on the camera Real-time display of camera images Update image cache Defect detection Display defect detection results Store result image Send test results through the serial-port Stop detection? Yes Turn off the camera End N Enter detection mode? Yes No Figure 5. Flowchart of the software system. _Sensors_ 2020, _20_, 392 6 of 17 Figure 6. Magnetic ring detection program interface for No. 1 vision machine and No. 2 vision machine. 3. Methods This section presents the details of the proposed approach for magnetic ring defect detection. The proposed methods include image preprocessing, IERA, MRLA, connected domain filtering method and the final part to measure the height of magnetic rings. The preprocessing step segments the suspected defect area with IERA and MRLA. Eventually, connected domain filtering identifies defects by analyzing morphological features. The details are as follows. _3.1._ _Image Preprocessing_ The defects to be detected on the surface include cracks, pits, adhesions, foreign matters, fibers, etc. Aimed at simplifying the detection problem, all defects are categorized into three categories, which are crack, fiber and large-area defects. Meanwhile, due to inherent problems with the system hardware, positioning error and uneven illumination will occur in magnetic ring images. To eliminate the unnecessary information and extract the key features in the image, a series of image preprocessing steps is performed. Figure 7 depicts the process of image processing. It is noticed that the gray-level and gradient defect features should be extracted separately in the preprocessing stage as the basis. Firstly, after extracting the ROI (region of interest) region of the input image, Otsu’s [19] method is used to compute the gray threshold. Then, MRLA is used to calculate the position of the magnetic ring, solving the problem of positioning error. Subsequently, on the one hand, we perform sub-region gray threshold segmentation [20] to solve the uneven illumination problem and use IERA to acquire gray-level defect images. On the other hand, the Sobel operator is used to perform the gradient calculation. Finally, IERA is utilized to obtain the gradient image of defects. The magnetic ring appears as a curved surface in the image. The middle area of images is dark and the areas at both ends are bright due to the designed lighting system and the location of the camera (Figure 8h). To solve this uneven illumination problem, as mentioned above, sub-region gray threshold _Sensors_ 2020, _20_, 392 7 of 17 segmentation is performed. First, Otsu’s method computes an optimal threshold that minimizes the intra-class variance. Suppose _pi_ is the percentage of pixels with value _i_ . The threshold _T_ is computed according to Equation (1). min _T_ <sup>σ2int</sup> <sup>_ra_</sup> <sup>(</sup> <sup>_T_</sup> <sup>) =</sup> <sup>_nB_</sup> <sup>(</sup> <sup>_T_</sup> <sup>)σ</sup> _B_ <sup>2</sup> min _T_ _B_ <sup>2</sup> <sup>(</sup> <sup>_T_</sup> <sup>) +</sup> <sup>_nA_</sup> <sup>(</sup> <sup>_T_</sup> <sup>)σ2</sup> _A_ <sup>2</sup> _A_ <sup>(</sup> <sup>_T_</sup> <sup>)</sup> (1) where _nB_ ( _T_ ) = _nA_ ( _T_ ) = _T_ −1 _i_ =1 _L_ −1 _i_ =1 _pi_, and σ <sup>2</sup> _B_ <sup>(</sup> <sup>_T_</sup> <sup>) = variance of pixels below</sup> <sup>_T_</sup> <sup>.</sup> (2) _pi_, and σ <sup>2</sup> _A_ <sup>(</sup> <sup>_T_</sup> <sup>) = variance of pixels above</sup> <sup>_T_</sup> <sup>.</sup> (3) According to the illumination performance, the target magnetic ring in the image is divided into _i_ regions. The threshold value _Ti_ of the _i_ - th region is defined by Formula (4). _Ti_ = _T_ - _Di_ (4) The threshold decay term _Di_ is obtained through experiments. Suppose _H_ is a grayscale image and _G_ stands for the image after thresholding. The _i_ - th region is binarized using Formula (5). An example is shown in Figure 8d. To prove the stability of the used image preprocessing method in relation to illumination, we change the illumination conditions (see Figure 9a,d) and conduct experiments with all other conditions being equal. The results confirm that the method has good robustness to illumination. - 1, _if_ _Hi_ ( _m_, _n_ ) > _Ti_ _Gi_ ( _m_, _n_ ) = (5) 0, _otherwise_ Input image Extracting ROI Region Computing threshold Computing Position(MRLA) Grayscale image Image Preprocessing Thresholding Sobel gradient calculation Gradient image Removing Thresholding edge(IERA) Gray-level image of defects Defect detection Marking Result Removing edge(IERA) Gradient image of defects Figure 7. Flow diagram of the image processing. _Sensors_ 2020, _20_, 392 8 of 17 LEC Outer torus of ring OEC Upper end -face IEC OEC LEC Upper end face Inner torus of ring IEC ( a ) ( b ) ( c ) ( d ) ( e ) ( f ) ( g ) ( h ) Figure 8. Torus image processing: ( a ) annotation of torus images; ( b ) location result; ( c ) original defect image of torus (2056 × 600); ( d ) torus gray binary image; ( e ) edge-removed torus gray binary image; ( f ) torus gradient binary image; ( g ) edge-removed torus gradient binary image; ( h ) segmentation of torus images. ( a ) ( b ) ( c ) ( d ) ( e ) ( f ) Figure 9. ( a - f ) Torus gray binary images. _3.2._ _Magnetic Ring Location Algorithm_ For the sake of carrying out accurate inspection, the position of the magnetic ring should be determined quickly. On account of the hardware, the position of the magnetic ring is unfixed in the system and the location migration occurs mainly in one direction. To solve the problem, MRLA (see Algorithm 1) is proposed to calculate the position of the magnetic ring in the image. Figure 8b shows examples of torus image location results. As for end face images, Algorithm 1 is adopted to acquire the top position _top_, and the bottom position _bot_ . Suppose _Tl_ is the positioning threshold. Then, in step 5, the scanning direction is changed to left-to-right. Finally, the left position _left_ and the right position _right_ are obtained. Let _Center_ ( _x_, _y_ ) denote the magnetic ring center position, whereas _x_ = ( _left_ + _right_ ), and _y_ = ( _top_ + _bot_ )/2. An example is shown in Figure 10e. _Sensors_ 2020, _20_, 392 9 of 17 Algorithm 1 Magnetic Ring Location Algorithm 1: Given a grayscale torus image _H_ ∈ _R_ <sup>_M_</sup> <sup>×</sup> <sup>_N_</sup> . 2: Use sub-region gray threshold segmentation to obtain a binary image _G_ h. 3: for I = 0, . . ., M do 4: Scan _G_ h from top to bottom. 5: Count the number δ of black dots. 6: if δ > _Tl_ 7: Get the up position _up_ = _i_ . 8: end 9: end 10: for I = 0, . . ., M do 11: Scan _G_ h from bottom to top. 12: Count the number δ of black dots. 13: if δ > _Tl_ 14: Get the down position _down_ = _i_ . 15: end 16: end 17: Output the location result _up_ and _down_ . ( a ) ( b ) ( c ) ( d ) ( e ) Figure 10. End face image processing: ( a ) segmentation of end face images; ( b ) end face image (2452 × 2056); ( c ) edge-removed end face image; ( d ) edge-removed end face binary image; ( e ) location result and annotation. _3.3._ _Image Edge Removal Algorithm_ In the image preprocessing procedure, it is found that gradient binary images and grayscale images contain the inner edge contour (IEC) of the upper end face, the outer edge contour (OEC) of the upper end face, and the lower edge contour (LEC) of the magnetic ring, as shown in Figure 8a. These edges will interfere with the subsequent defect filtering. To better isolate defects from images, IERA is proposed to eliminate these edges. The edge of the magnetic ring behaves differently in different kinds of pictures. To extract the defect features of different surfaces, IERA is divided into three parts. Algorithm 2 Part I, Part II and Part III de ~~scribe IERA for torus grayscale images, torus gradient images and end face binar~~ y images, respectively. Figure 8c–g shows the process of IERA. By means of Algorithm 2 Part I, torus gray binary images after removing the upper end face are shown in Figure 8e. To illustrate the algorithm, a sketch is shown in Figure 11. Sometimes, defects, such as recessive cracks and fibers, are inconspicuous in gray binary images. However, they could be easily observed in gradient binary images. By using Algorithm 2 Part II, the edge-removed torus gradient image can be obtained (see Figure 8g). Besides, according to the imaging characteristics of the end face of magnetic rings, through Algorithm 2 Part III, we can obtain the edge-removed end face image (see Figure 10c). Furthermore, after sub-region gray threshold segmentation, an edge-removed end face binary image with defect features is shown in Figure 10d. _Sensors_ 2020, _20_, 392 10 of 17 Algorithm 2 Image Edge Removal Algorithm Part I Part II Part III 1: Given a grayscale image _H_ ∈ _R_ <sup>_M_</sup> <sup>×</sup> <sup>_N_</sup> . 2: Process and get gray binary image _Gd_ . 3: for I = 0, . . ., M do 4: Set the array of IEC to _Left_ [ _i_ ], set the array of OEC to _Right_ [ _i_ ]. 5: for j = 0, . . ., N − 2 do 6: if _G_ d[ _i_, _j_ + _k_ ] == 0( _k_ = 0, 1, 2) 7: Get _Left_ [ _i_ ] = _j_ . 8: end 9: end 10: for j = _Left_ [ _i_ ], . . ., N − 4 do 11: if _G_ d[ _i_, _j_ + _k_ ] == 255( _k_ = 0, . . ., 4) 12: Get _Right_ [ _i_ ] = _j_ . 13: end 14: end 15: for j = 0, . . ., N do 16: if _Left_ [ _i_ ] ≤ _j_ ≤ _Right_ [ _i_ ] 17: Set _Gd_ [ _i_, _j_ ] = 255 18: end 19: end 20: end 21: Output the edge-removed gray binary image _Gd_ . 1: Given a grayscale image _H_ ∈ _R_ <sup>_M_</sup> <sup>×</sup> <sup>_N_</sup> . 2: Obtain a binary image _Gd_ 1 and an image _G_ h with high threshold binarization. Use Sobel operator to obtain gradient binary image _Gw_ . 3: for i = 0, . . ., M do 4: Set the array of IEC to _TopL_ [ _i_ ], set the array of LEC _B_ ot[ _i_ ] and set the array of OEC to _Top_ [ _i_ ]. 5: for j = 0, . . ., N − 4 do 7: if _G_ h[ _i_, _j_ + _k_ ] == 0 ( _k_ = 0, · · ·, 4) 8: Get _TopL_ [ _i_ ] = _j_ . 9: end 10: end 11: for j = _TopL_ [ _i_ ], . . ., N − 4 do 13: if _G_ h[ _i_, _j_ + _k_ ] == 255 ( _k_ = 0, · · ·, 4) 14: Get _B_ ot[ _i_ ] = _j_ . 15: if _Gd_ 1[ _i_, _j_ + _k_ ] == 255 ( _k_ = 0, · · ·, 4) 16: Get _T_ op[ _i_ ] = _j_ . 17: end 18: end 19: for j = 0, . . ., N do 20: if 0 ≤ _j_ ≤ _Top_ [i] + 15 or ��� _j_ - _Bot_ [i]��� ≤ 20 21: Set _Gw_ [ _i_, _j_ ] = 0. 22: end 23: end 24: end 25: Output the edge-removed torus gradient image _Gw_ . 1: Given a grayscale end face image _H_ ∈ _R_ <sup>_M_</sup> <sup>×</sup> <sup>_N_</sup> . 2: Process and get binary image _G_ h. 3: Create a white circle _C_ 1 with ( _Center_ ( _x_, _y_ ), ( _Top_ + _Bot_ ), _w_ 1) as its center, radius and line width, respectively. 4: for _j_ = _y_, _y_ - 1, . . .,4 do 5: Scan upward from _Center_ ( _x_, _y_ ). 6: if _G_ h[ _x_, _j_ - _k_ ] == 0 ( _k_ = 0, · · ·, 4) _Sensors_ 2020, _20_, 392 11 of 17 7: Get _R_ 2 = _y_ - _j_ . 8: end 9: end 10: Create a white circle _C_ 2 with ( _Center_ ( _x_, _y_ ), _R_ 2, _w_ 1) as its center, radius and line width, respectively. 11: Use _C_ 1 and _C_ 2 to remove edges. 12: Output the edge-removed grayscale end face image. j-th column i-th row Scan <sup>_G_</sup> _d_ [, <sup>_i_</sup> <sup>_j_</sup> -1] _Gd_ [, _i_ _j_ ] _Gd_ [, _i_ _j_ +1] _Gd_ [, _i_ _j_ +2] _Left_ [ _i_ ] = _j_ _Gd_ [, _i_ _j_ -1] _Gd_ [, _i_ _j_ ] _Gd_ [, _i_ _j_ +1] _Gd_ [, _i_ _j_ +2] _Gd_ [, _i_ _j_ -1] _Right_ [ _i_ ] = _j_ _Left_ [ _i_ ] ≤ _j_ ≤ _Right_ [ _i_ ] _Gd_ [, _i_ _j_ ] = 0 Figure 11. Sketch of the image edge removal algorithm. _3.4._ _Connected Domain Filtering Method_ After preprocessing, the remaining connected components represent the potential defect areas. As the size and shape of defect should meet certain conditions to be mechanically significant, the connected components are further filtered by thresholds [21]. In accordance with statistics, the specific characteristics of the three types of defects are as follows: - Crack defect: It can be categorized into obvious crack and recessive crack. The obvious crack is <u>shown as a thick line in the image and has a strong contrast with the torus region.</u> <u>The recessive</u> crack is opposite to the obvious crack. - Large-area defect: It is characterized by obvious protrusion or depression, a strong contrast with the surrounding area and a large defect area. - Fiber defect: It has the characteristics of low gray-level discrimination with the surrounding area, inconspicuous protrusion, irregular shape, and fine lines. For obvious cracks in contact with the end face of the magnetic ring, detection is performed by sca ~~nning the upper edge array~~ _~~Top~~_ ~~[~~ _~~i~~_ ~~] to detect the curvature transition point [22].~~ ~~Let~~ _~~T~~_ _q_ ~~denote the~~ curvature threshold. If Formula (6) is satisfied, a crack defect is found. _Top_ [ _i_ ][ _j_ ] − _Top_ [ _i_ - 8][ _j_ ] > _Tq_ ( _i_ = _up_ + 8, _up_ + 9, . . ., _down_ ; _j_ = 1, 2, . . ., 7) (6) Large-area defects and the rest of the obvious cracks have common characteristics, such as large contrast with normal torus, obvious morphological features in binary images, and large area of connected domains. So, same method based on connected domain filtering is used to solve the two similar problems (see Algorithm 3 Part I below). Let us define the minimum bounding rectangle _T_ (with length _H_ and width _W_ ) of the connected domain. Let _T_ wh denote the length and width ratio threshold of the connected domains and _R_ wh denote the ratio of the connected domain to the area of its minimum bounding rectangle. _T_ h and _T_ w represent the length threshold and the width threshold of _T_, respectively. Finally, suppose the threshold of the area of connected domains is denoted by _Ts_ . _Sensors_ 2020, _20_, 392 12 of 17 Algorithm 3 Connected Domain Filtering Method 1: Give a gray binary image _Gd_ or a gradient binary image _G_ w. 2: Process and get _Gd_ ’s anti-color image _Gdc_ . 3: Get the connected domain set _Q_ and the number k of the connected domain. 4: for _i_ = _1_, . . ., _k_ do Part I Part II Get the area _Si_ of the connected domain _Qi_ ∈ _Q_, the minimum bounding rectangle _Ti_ (with 5: length _Hi_ and width _Wi_ ). 6: Set each value of ( _T_ wh, _R_ wh, _T_ h, _T_ w, _Ts_ ). 7: if _condition_ is satisfied 8: _Qi_ is judged to be a defect. 9: end 10: end 11: Output the results. 1: Given a gradient binary image _G_ w. 2: Get the width _W_ of _G_ w. Set the step length _step_ and a rectangular search box _Sbox_ with a width of _wb_ and a length of _hb_ . 3: Set number of connected domains _Ni_ = 0. 4: for _i_ = 1, . . . _wb_ + _i_ ∗ _step_, . . ., _W_ do 5: Use _Sbox_ to traverse _G_ w from top to bottom in steps of _step_ . 6: For the _i_ - _th Sbox_, get k connected domains. 7: for _j_ = 1, . . ., _k_ do Get the area _S_ _j_ of the connected domain _Q_ j ∈ _Q_, the minimum bounding rectangle _T_ _j_ (with 8: length _Hi_ and width _W_ _j_ ). 9: Set each value of ( _T_ wh, _R_ wh, _T_ h, _T_ w, _Ths_, _Tss_ ). 10: if _condition_ 1 is satisfied. 11: _Ni_ + = 1 and save the coordinate of the connected domain ( _xj_, _y_ _j_ ). 12: end 13: end 14: Set _Tn_ and _Ths_ . 15: if _condition_ 2 is satisfied. 16: The _i_ - _th Sbox_ contains defects. 17: end 18: end 19: Output the results. With regard to obvious cracks, the connected domain is represented as a thick straight line (see Figure 12c). For the connected domain and its minimum bounding rectangle, by extensive experiments, we define that if conditions, such as _H_ - _Th_, _W_ < _Tw_, _H_ / _W_ - _Twh_ and _S_ /( _W_ × _H_ ) > _Rwh_, are satisfied, connected domains are identified as obvious cracks. So, the filter criterion _condition_ can be expressed as (7). _Hi_ / _Wi_ - _Twh_ && _Si_ /( _Wi_ × _Hi_ ) > _Rwh_ && _Hi_ - _Th_ && _Wi_ < _Tw_ (7) For large-area defects, connected domains are characterized by large, irregular shapes (see Figure 12a). On the basis of statistics, it is defined that if conditions, such as _H_ - _Th_, _W_ - _Tw_, _H_ / _W_ - _Twh_ and _S_ /( _W_ × _H_ ) - _Rwh_, are satisfied, connected domains can be defined as large-area cracks. So, the filter criterion _condition_ can be expressed as (8). _Si_ - _Ts_ && _Si_ /( _Wi_ × _Hi_ ) > _Rwh_ && _Wi_ - _Tw_ && _Hi_ - _Th_ (8) Fiber defects and recessive crack defects do not have strong contrast with normal torus. In binary images, they appear as several small connected domains distributed in a certain region. Therefore, these two defects are filtered according to the characteristics of connected domains and the relationship between connected domains. Let _Tn_ denote the number threshold of the connected domain in the _Sensors_ 2020, _20_, 392 13 of 17 search box. _Ths_ represents the width sum threshold of the connected domain, and _Tss_ delegates the area sum threshold of the connected domain. _H_ _i_ _Wi_ <sup>_T_</sup> _i_ is the minimum bounding rectangle _Q_ _j_ <sup>_T_</sup> _j_ _H_ _j_ _H_ j+1 _H_ j+2 <sup>_T_</sup> _j_ +1 <sup>_T_</sup> _j_ +2 _H_ _j_ j-th _W_ _j_ <sup>_S_</sup> _j_ i-th search box _Q_ _j_ is one of the connected domain in i-th search box (a) Large-area defect (b) Recessive crack _Wi_ <sup>_T_</sup> _i_ _S_ _j_ +1 is the area of j+1-th connected domain in the i-th search box _Hi_ j+1-th _H_ _j_ +1 _W_ _j_ +1 <sup>_S_</sup> _i_ is the area of i-th connected domain Binary image <sup>_T_</sup> _j_ <sup>_T_</sup> _j_ +1 _H_ _j_ _H_ _j_ +1 i-th search box (c) Obvious crack (d) Fiber Figure 12. Illustratory diagram of connected domain filtering. Recessive cracks appear (Figure 12b) as several disconnected lines in the processed binary image. For example, Figure 12b describes a recessive crack and its made up of three line segments. Like the obvious crack, in Algorithm 3 Part II, the filter criterion _condition_ 1 is expressed as condition (9) to identify whether the segments are part of a crack defect. Furthermore, what really matters is the relationship between the segments. <sup>�</sup> _Hj_, the sum of the minimum bounding rectangle length of adjacent connected domains in a search box _Sbox_, is selected as the filtering criterion. Through extensive experiments, we define that if conditions _Ni_ >= _T_ n and <sup>�</sup> _Hj_ ≥ _Ths_ are satisfied, _Sbox_ is determined to contain a recessive crack. So, replacing _condition_ 2 with condition (10), the method can detect the recessive crack correctly. _Hj_ / _W_ _j_ - _Twh_ && _Sj_ /( _W_ _j_ × _Hj_ ) > _Rwh_ && _Hj_ - _Th_ && _Wj_ < _Tw_ (9) _Ni_ >= _T_ n&& _Ni_ _j_ =1 _Hj_ ≥ _Ths_ (10) Fiber defects appear as several irregularly disconnected connected domains in the processed binary image (see Figure 12d). In the first place, condition (11) is introduced to take the place of _condition_ 1 to identify whether connected domain _Qj_ is part of a fiber. Subsequently, by extensive experiments, it is found that the sum <sup>�</sup> _S_ _j_ of the connected domain area is more useful in defect detection than the sum <sup>�</sup> _Hj_ of minimum bounding rectangle length. Thus, the filter criterion _condition_ 2 is expressed as (12). _S_ _j_ - _Ts_ && _W_ _j_ - _Tw_ && _Hj_ - _Th_ (11) _Ni_ >= _T_ n2&& _3.5._ _Measurement Method of Magnetic Ring Height_ _Ni_ _j_ =1 _S_ _j_ ≥ _Tss_ (12) In addition to defect detection, height measurement is also an important target of this system. In the magnetic ring height image, the glass wheel’s area is fixed (see Figure 13b) and can be removed _Sensors_ 2020, _20_, 392 14 of 17 by setting the fixed area of the grayscale image to white (see Figure 13c). Then, MRLA is used to calculate the position of the magnetic ring and get the upper position _up_ and lower position _down_ . Subsequently, the pixel height of the magnetic ring _height_ = _down_ - _up_ is obtained. ( a ) ( b ) ( c ) ( d ) Figure 13. ( a ) Schematic diagram of spatial position measurement in the vertical direction; ( b ) a magnetic ring height image; ( c ) a binary image after removing the glass area; ( d ) a result of height measurement. According to the imaging principle of the camera, the spatial position measurement diagram of the target vertical direction in the image is shown in Figure 13a. Let π denote the imaging plane and _O_ denote the lens center of the camera. _V_ presents the image distance from the light center to the image plane, and _Z_ defines the distance from the object to the image plane. From the triangle similarity principle, we can obtain: _Y_ = <sup>_<u>Z</u>_</sup> <sup>−</sup> <sup>_<u>V</u>_</sup> _y_ (13) _V_ Formula ( _Z_ - _V_ )/ _V_ is fitted through experiments, and _y_ = _height_ is substituted into Formula (13) to obtain the actual height of the magnetic ring. Through practical verification, ultimately, the precision of height measurement is about 0.02 mm. 4. Experiments _4.1._ _Examples of Defect Detection_ All the proposed algorithms and methods are applied to the magnetic ring detection system. Then, we perform some experiments to check the operation of the system. According to the manufacturing process, we find that crack and fiber defects mainly appear in the inner and outer ring surfaces. Hence, we can detect them from the inner and outer ring surfaces. It is noteworthy that various kinds of large-area defects will appear on the outer ring and the end face, and the large-area defect on the inner ring is an adhesion defect. The results are shown below, including magnetic ring height (Figure 13d), fiber defects (Figure 14), crack defects (Figure 15) and large-area defects (Figure 16). For different defects located on different surfaces, the system can accurately judge whether it is a defect and mark the position. Figure 14. Detection results of fiber defects. _Sensors_ 2020, _20_, 392 15 of 17 Figure 15. Detection results of crack defects. Figure 16. Detection results of large-area defects. _4.2._ _Statistical Results of Defect Detection_ In the system, visual machines are equipped with an Intel Core i5-5350U CPU 1.8 GHz processor with 2-GB RAM, and the host computer is equipped with an Intel Core i5-4590 3.3 GHz processor with 4-GB RAM. The experimental results are evaluated by two sub-tasks. One is to evaluate how fast the image processing is (efficiency), and the other is to assess the capability of the algorithm in detecting defect images (accuracy). For the sake of testing the speed of the system, in the experiment, 2400 magnetic rings are continuously detected and the execution time of each vision machine is calculated. As shown in Table 1, for different vision machines, it can be found that the maximum detection time of a single magnetic ring is 510 ms, and the maximum average detection time is 455 ms. In other words, the proposed detection system eventually reaches an average detection speed of about 120 pcs/min. For the second sub-task, in order to test the system accuracy for various defects’ detection, we select 200 magnetic rings for each type of defect and test them. Table 2 demonstrates the statistical results. By counting the results of various defects’ detection, it can be concluded that the accuracy for crack and large-area defects, such as adhesion, hanger adhesion and pitting, reaches 100%. Meanwhile, the accuracy for foreign matters and fibers achieves 92.5% and 91.5%, respectively. From the results, _Sensors_ 2020, _20_, 392 16 of 17 it is confirmed that the proposed method and system possess good performance. Both the accuracy and the speed are suitable for magnetic ring real-time online inspection in the automated production line. Table 1. Inspection time statistics of the vision machine. Number of Maximum Time Detected Content Visual Machines Consumption (ms) Minimum Time Consumption (ms) Average Time Consumption (ms) 1 Outer and inner rings 510 395 436 2 Lower end face 470 412 425 3 Inner ring 260 180 220 4 Outer ring, inner ring 495 402 440 5 Outer ring, inner ring 490 406 443 6 Outer ring, upper end surface 500 420 455 Table 2. Defect detection statistics. Total Number of Number Name Magnetic Rings Number of Recognition Rate Identifications 1 Crack 200 200 100% 2 Adhesion 200 200 100% 3 Hanger adhesion 200 200 100% 4 Pitting 200 200 100% 5 Foreign body 200 185 92.5% 6 Fiber 200 183 91.5% 5. Conclusions In this paper, we propose a defect detection system for magnetic rings and adopt advanced multi-camera vision technology. The system includes two efficient image processing algorithms, which are IERA and MRLA. By using the detection method for cracks, fibers and large-area defects based on connected domain filtering, it solves the difficult defect detection problem for three-dimensional magnetic rings with high speed and precision. The experiment results demonstrate that machine vision can substitute most of the manual operations in magnetic ring defect detection, greatly improving the production efficiency and the automation degree. In the developed system, the hardware platform and software system are studied and designed in depth, and the final developed system is experimentally verified. Compared with existing systems, the current system has more comprehensive functions and a good integration degree. The device and method have a high detection precision, can realize real-time online detection of three-dimensional magnetic rings, and can be widely applied in magnetic ring production. Author Contributions: All authors contributed extensively to the work presented in this paper and wrote the manuscript. X.Z. provided technical guidance and wrote the initial version of the paper. W.G. instructed the software and the whole development. X.X. conducted the investigation and gave guidance. All authors have read and agreed to the published version of the manuscript. Funding: National Natural Science Foundation of China: No. 61673316; Major Science and Technology Project of Guangdong Province: No. 2015B010104002. Acknowledgments: This work is supported by the National Natural Science Foundation of China (No. 61673316), and the Major Science and Technology Project of Guangdong Province (No. 2015B010104002). Conflicts of Interest: The authors declare no conflict of interest. References 1. Liu, L.J.; Wang, Y. Ferrite core appearance inspection using gray histogram and support vector machine. _Chin._ _J. Sci._ _Instrum._ 2006, _27_, 840–844. 2. Pei, C.; Fukuchi, T.; Zhu, H. A Study of Internal Defect Testing With the Laser-EMAT Ultrasonic Method. _IEEE Trans._ _Ultrason._ _Ferroelectr._ _Freq._ _Control_ 2012, _59_, 2702–2708. _Sensors_ 2020, _20_, 392 17 of 17 3. Liu, S.; Dong, S.; Zhang, Y. Defect Detection in Cylindrical Cavity by Electromagnetic Ultrasonic Creeping Wave. _IEEE Trans._ _Magn._ 2017, _54_, 6200305. [[CrossRef]](http://dx.doi.org/10.1109/TMAG.2017.2759121) 4. Wataru, Y.; Ryo, T.; Teruyoshi, S.; Keiji, E. Detection of Slit Defects on Backside of Steel Plate Using Low-Frequency Eddy-Current Testing. _IEEE Trans._ _Magn._ 2018, _54_, 6202505. 5. D’Angelo, G.; Laracca, M.; Rampone, S. Fast Eddy Current Testing Defect Classification Using Lissajous Figs. _IEEE Trans._ _Instrum._ _Meas._ 2018, _67_, 821–830. [[CrossRef]](http://dx.doi.org/10.1109/TIM.2018.2792848) 6. Cheng, L.; Tian, G.Y. Surface Crack Detection for Carbon Fiber Reinforced Plastic (CFRP) Materials Using Pulsed Eddy Current Thermography. _IEEE Sens._ _J._ 2011, _11_, 3261–3268. [[CrossRef]](http://dx.doi.org/10.1109/JSEN.2011.2157492) 7. Tolba, A.S.; Raafat, H.M. Multiscale image quality measures for defect detection in thin films. _Int._ _J. Adv._ _Manuf._ _Technol._ 2015, _79_, 113–122. [[CrossRef]](http://dx.doi.org/10.1007/s00170-014-6758-7) 8. Boby, R.A.; Sonakar, P.S. Identification of defects on highly reflective ring components and analysis using machine vision. _Int._ _J. Adv._ _Manuf._ _Technol._ 2011, _52_, 217–233. [[CrossRef]](http://dx.doi.org/10.1007/s00170-010-2730-3) 9. Medina, R.; Gayubo, F. Automated visual classification of frequent defects in flat steel coils. _Int._ _J. Adv._ _Manuf._ _Technol._ 2011, _57_, 1087–1097. [[CrossRef]](http://dx.doi.org/10.1007/s00170-011-3352-0) 10. Gamage, P.; Xie, S.Q. A real-time vision system for defect inspection in cast extrusion manufacturing process. _Int._ _J. Adv._ _Manuf._ _Technol._ 2009, _40_, 144–156. [[CrossRef]](http://dx.doi.org/10.1007/s00170-007-1326-z) 11. Li, Q.; Ren, S. A Visual Detection System for Rail Surface Defects. _IEEE Trans._ _Syst._ 2012, _42_, 1531–1542. [[CrossRef]](http://dx.doi.org/10.1109/TSMCC.2012.2198814) 12. Tsai, D.M.; Hsieh, Y.C. Machine Vision-Based Positioning and Inspection Using Expectation-Maximization Technique. _IEEE Trans._ _Instrum._ _Meas._ 2017, _66_, 2858–2868. [[CrossRef]](http://dx.doi.org/10.1109/TIM.2017.2717284) 13. Chen, T.; Wang, Y.; Xiao, C.; Wu, Q.M.J. A Machine Vision Apparatus and Method for Can-End Inspection. _IEEE Trans._ _Instrum._ _Meas._ 2016, _65_, 2055–2066. [[CrossRef]](http://dx.doi.org/10.1109/TIM.2016.2566442) 14. Ko, J.S.; Rheem, J.Y. Defect detection of polycrystalline solar wafers using local binary mean. _Int._ _J. Adv._ _Manuf._ _Technol._ 2016, _82_, 1753–1764. [[CrossRef]](http://dx.doi.org/10.1007/s00170-015-7498-z) 15. Xu, H.; Hou, D.X.; Qiu, J.; Ye, S.L. Extracting crack signal of magnetic ring based on MAX262. In Proceedings of the Eighth International Symposium on Precision Engineering Measurement and Instrumentation, Chengdu, China, 8–11 August 2012. 16. Yu, Z.J.; Li, X.Z.; Yu, H.D.; Xie, D. Research on surface defect inspection for small magnetic rings. In Proceedings of the 2009 International Conference on Mechatronics and Automation, Changchun, China, 9–12 August 2009. 17. Li, J.F.; Zhang, Z.X.; Shen, J.M. Study on surface defect extraction of magnetic ring based on texture suppression. _J. Optoelectron._ _Laser_ 2017, _28_, 978–985. 18. Wang, Y.N.; Chen, T.J.; He, Z.D.; Wu, C.Z. Review on the machine vision measurement and control technology for intelligent manufacturing equipment. _Control Theory Appl._ 2015, _32_, 273–286. 19. Otsu, N. Threshold Selection Method from Gray-Level Histograms. _IEEE Trans._ _Syst._ _Man Cybern._ 1979, _9_, 62–66. [[CrossRef]](http://dx.doi.org/10.1109/TSMC.1979.4310076) 20. Qian, K.; Li, F.; Wen, Y.M. Color and Space Distance Based Salient Region Detection Using Fixed Threshold Segmentation. _Comput._ _Sci._ 2016, _43_, 103–106. 21. Ren, R.; Hung, T.; Tan, K.C. Automatic Microstructure Defect Detection of Ti-6Al-4V Titanium Alloy by Regions-Based Graph. _IEEE Trans._ _Emerg._ _Top._ _Comput._ _Intell._ 2017, _1_, 87–96. [[CrossRef]](http://dx.doi.org/10.1109/TETCI.2017.2669523) 22. Jiang, J.D.; Chen, P.Y.; Tong, Y.J.; Hoogmoed, W. Study on the defect inspection algorithm of touch switch pins based on machine vision. _J. Zhejiang Univ._ _Technol._ 2015, _43_, 30–33. © 2020 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution [(CC BY) license (http://creativecommons.org/licenses/by/4.0/).](http://creativecommons.org/licenses/by/4.0/.)

섹션 본문 67문단 · 43,786자

(제목 없음)

1Magnetic rings are the most widely used magnetic material product in industry. The existing manual defect detection method for magnetic rings has high cost, low efficiency and low precision. To address this issue, a magnetic ring multi-defect stereo detection system based on multi-camera vision technology is developed to complete the automatic inspection of magnetic rings. The system can detect surface defects and measure ring height simultaneously. Two image processing algorithms are proposed, namely, the image edge removal algorithm (IERA) and magnetic ring location algorithm (MRLA), separately. On the basis of these two algorithms, connected domain filtering methods for crack, fiber and large-area defects are established to complete defect inspection. This system achieves a recognition rate of 100% for defects such as crack, adhesion, hanger adhesion and pitting. Furthermore, the recognition rate for fiber and foreign matter defects attains 92.5% and 91.5%, respectively. The detection speed exceeds 120 magnetic rings per minutes, and the precision is within 0.05 mm. Both precision and speed meet the requirements of real-time quality inspection in actual production.

Introduction

2Magnetic materials are commonly used in electronic circuits as anti-interference components. As the main product, magnetic rings are widely used in aerospace, military electronics, automobiles, sensors, the petrochemical industry, magnetic drives and other fields [1]. During the production process, due to the production environment and processing procedures, defects, such as crack, adhesion, pitting, foreign matter and fiber defects, will appear on the surface of the magnetic ring. These defects would affect the appearance and performance of industrial products. Therefore, high-efficiency and high-precision surface detection of magnetic rings is crucial for manufacturing enterprises. However, surface defect detection and height measurement of magnetic rings by manual inspection, which is currently widely used, are costly, inefficient, low-speed and low-accuracy. Hence, it is significant to design an automated system to complete real-time defect detection and height measurement for magnetic rings.

3In recent years, many excellent technical solutions for defect detection have been proposed by researchers. The ultrasonic testing technique [2,3], eddy current testing technique [4][5][6] and vision inspection technique [7][8][9][10] are widely used. Among them, in practical production, the vision inspection technique has been successfully adopted for surface detection of industrial products because of its convenience, effectiveness and cost performance. Li and Ren [11] developed an intelligent vision detection system for discrete rail surface defects. Tsai and Hsieh [12] proposed a fast image alignment method by using the expectation-maximization (E-M) technique, which accomplished the positioning and defect inspection of printed circuit boards (PCBs). Furthermore, an entropy-rate clustering algorithm combined with prior shape constraint was proposed by Chen [13] to detect defects and deformations across an imaged can-end surface. Ko and Rheem [14] inspected the surface defects of solar wafers by using the local binarization method.

4Furthermore, aimed at the inspection of magnetic ring surfaces, researchers have carried out active research. By using the ultrasonic testing technique, Xu [15] designed a programmable filter based on the MAX262 chip, and used the fourth-order Chebyshev bandpass filter to extract weak vibration signals for detecting cracks in the magnetic ring. However, the detection of defects other than cracks was not considered. Using the vision inspection technique, Yu [16] designed an automatic vision-based detection system and used an improved BHPF (butterworth high pass filter) filter for denoising. Nevertheless, the designed system only completed the detection of the magnetic ring end face, which is not comprehensive. Furthermore, Li and Zhang [17] proposed a surface defect extraction method for magnetic rings based on the adaptive Canny algorithm of the edge-detection method and masking technology. However, the detection of the inner torus was not considered.

5To measure the multiple dimensions of magnetic rings quickly and to detect and classify the defects precisely, this paper develops a magnetic ring intelligent detection system based on multi-camera vision technology. A wide range of aspects is considered to ensure that no defect or surface is missing, making our system more comprehensive than the systems mentioned above. Trapped by multiple tasks and diverse defects, the traditional single vision system cannot obtain enough information. So, multiple vision machines are used in the system, which guarantees high-speed defect detection on multiple surfaces of three-dimensional magnetic rings. Two image processing algorithms are proposed, namely, the image edge removal algorithm (IERA) and magnetic ring location algorithm (MRLA), respectively, which effectively solve the defect segmentation problem. Finally, by using reasonable thresholds obtained through experiments, connected domain filtering methods are indicated to localize defects quickly and accurately.

6The rest of this paper is organized as follows. Section 2 describes the hardware and software components of the multi-vision machine intelligent detection system; Section 3 describes the defect detection algorithm for each surface and the height measurement method; Section 4 demonstrates the detection results of the system. Finally, the conclusions are given in Section 5.

Hardware Design

7As can be seen from Figure 1, the outer diameter and inner diameter of the magnetic ring to be tested are 22 and 20 mm. The height is 3.5 mm, and the color is gray. The structure is complicated and the types of defects are various, so how to realize the real-time online detection of all defects and surfaces is a difficult problem. One approach is using a single vision machine and rotational shooting mode, but this demands a high-precision rotary positioning system and the detect speed is too low to meet the requirements. Considering the fact that defects are distributed on all sides of the magnetic ring, we propose a solution that can complete image acquisition and processing synchronously by using multiple high-speed vision machines.

8This system mainly includes three modules, which are the visual inspection module, actuator module and host computer module (as shown in Figure 2). The visual inspection module contains six vision machines and achieves multi-view image collection, image processing and test results sending. The vision machine integrates camera control, card processing and serial communication to solve industrial automation production problems [18]. The host computer takes charge of the judgment Sensors 2020, 20, 392 3 of 17 results summary of all the vision machines and the control of the executing mechanism. The actuator module, consisting of a feeding device, a transmission device and a sorting device, completes the mechanical operation of the magnetic ring. The feeding device is responsible for feeding magnetic rings into the transmission device at a certain speed. The transmission device is in charge of transmitting magnetic rings from the feeding device to the sorting device. The sorting device finishes final defect classification according to the control signal of the host computer. This system mainly includes three modules, which are the visual inspection module, actuator module and host computer module (as shown in Figure 2). The visual inspection module contains six vision machines and achieves multi-view image collection, image processing and test results sending. The vision machine integrates camera control, card processing and serial communication to solve industrial automation production problems [18]. The host computer takes charge of the judgment results summary of all the vision machines and the control of the executing mechanism. The actuator module, consisting of a feeding device, a transmission device and a sorting device, completes the mechanical operation of the magnetic ring. The feeding device is responsible for feeding magnetic rings into the transmission device at a certain speed. The transmission device is in charge of transmitting magnetic rings from the feeding device to the sorting device. The sorting device finishes final defect classification according to the control signal of the host computer. Relying on the elaborate design, the actuator could successfully realize non-destructive detection. The vibrating feeding plate is used as the feeding device, whose vibration frequency is adjustable to ensure uniform feeding speed and avoid secondary damage. Meanwhile, since both the upper and lower end faces need to be detected, a glass turntable is employed as the driving device. In this way, by setting cameras and light sources above or below the glass disk, images are taken without flipping the magnetic ring. Furthermore, a solenoid valve is used as the sorting device to ensure the response speed and mechanical force. Ultimately, there will be no secondary damage to the magnetic ring.

9Besides, the hardware of the system has high expansibility and can be adjusted according to the actual requirements. Benefitting from multiple vision machines, this system has a high processing speed and a wide range of perspectives, which can deal with three-dimensional part detection problems. Nevertheless, with the use of multiple vision machines, the cost of the system is not that inexpensive. Furthermore, there are many components in the hardware system, so the complexity of the device brings some difficulties to the later management. Figure 3 shows the prototype of this multi-vision magnetic ring quality inspection system. This system mainly includes three modules, which are the visual inspection module, actuator module and host computer module (as shown in Figure 2). The visual inspection module contains six vision machines and achieves multi-view image collection, image processing and test results sending. The vision machine integrates camera control, card processing and serial communication to solve industrial automation production problems [18]. The host computer takes charge of the judgment results summary of all the vision machines and the control of the executing mechanism. The actuator module, consisting of a feeding device, a transmission device and a sorting device, completes the mechanical operation of the magnetic ring. The feeding device is responsible for feeding magnetic rings into the transmission device at a certain speed. The transmission device is in charge of transmitting magnetic rings from the feeding device to the sorting device. The sorting device finishes final defect classification according to the control signal of the host computer. Relying on the elaborate design, the actuator could successfully realize non-destructive detection. The vibrating feeding plate is used as the feeding device, whose vibration frequency is adjustable to ensure uniform feeding speed and avoid secondary damage. Meanwhile, since both the upper and lower end faces need to be detected, a glass turntable is employed as the driving device. In this way, by setting cameras and light sources above or below the glass disk, images are taken without flipping the magnetic ring. Furthermore, a solenoid valve is used as the sorting device to ensure the response speed and mechanical force. Ultimately, there will be no secondary damage to the magnetic ring.

10Besides, the hardware of the system has high expansibility and can be adjusted according to the actual requirements. Benefitting from multiple vision machines, this system has a high processing speed and a wide range of perspectives, which can deal with three-dimensional part detection problems. Nevertheless, with the use of multiple vision machines, the cost of the system is not that inexpensive. Furthermore, there are many components in the hardware system, so the complexity of the device brings some difficulties to the later management. Figure 3 shows the prototype of this multi-vision magnetic ring quality inspection system. To further illustrate the hardware system, a simplified diagram of the entire system is drawn, as shown in Figure 4. First, magnetic rings are fed into the system through the vibrating feeding plate. Then, it reaches the camera shooting point after adjusting the position and completing the counting. Subsequently, this system uses two stations to photograph the magnetic ring and detect Relying on the elaborate design, the actuator could successfully realize non-destructive detection. The vibrating feeding plate is used as the feeding device, whose vibration frequency is adjustable to ensure uniform feeding speed and avoid secondary damage. Meanwhile, since both the upper and lower end faces need to be detected, a glass turntable is employed as the driving device. In this way, by setting cameras and light sources above or below the glass disk, images are taken without flipping the magnetic ring. Furthermore, a solenoid valve is used as the sorting device to ensure the response speed and mechanical force. Ultimately, there will be no secondary damage to the magnetic ring.

11Besides, the hardware of the system has high expansibility and can be adjusted according to the actual requirements. Benefitting from multiple vision machines, this system has a high processing speed and a wide range of perspectives, which can deal with three-dimensional part detection problems. Nevertheless, with the use of multiple vision machines, the cost of the system is not that inexpensive. Furthermore, there are many components in the hardware system, so the complexity of the device brings some difficulties to the later management. Figure 3 shows the prototype of this multi-vision magnetic ring quality inspection system. To further illustrate the hardware system, a simplified diagram of the entire system is drawn, as shown in Figure 4. First, magnetic rings are fed into the system through the vibrating feeding plate. Then, it reaches the camera shooting point after adjusting the position and completing the counting. Subsequently, this system uses two stations to photograph the magnetic ring and detect defects. Station 1 contains a binocular vision machine and two cameras. These two cameras are responsible for measuring the height and detecting the lower end face. Station 2 consists of five vision machines with a total of nine cameras. Due to the inner and outer toruses of the magnetic ring being curved surfaces, the view of a single camera cannot cover all toruses. So, among them, four cameras are responsible for taking pictures of the outer surface, and four cameras are responsible for taking pictures of the Sensors 2020, 20, 392 4 of 17 inner surface. The last camera with a vertical view is located on the platform to detect the upper end face. After taking the picture, vision machines receive the image and perform defect detection. Then, all detection results are sent to the host computer. Finally, when the magnetic ring reaches the sorting device, the qualified and unqualified magnetic rings are separated.

12Sensors 2020, 20, x FOR PEER REVIEW 4 of 19 defects. Station 1 contains a binocular vision machine and two cameras. These two cameras are responsible for measuring the height and detecting the lower end face. Station 2 consists of five vision machines with a total of nine cameras. Due to the inner and outer toruses of the magnetic ring being curved surfaces, the view of a single camera cannot cover all toruses. So, among them, four cameras are responsible for taking pictures of the outer surface, and four cameras are responsible for taking pictures of the inner surface. The last camera with a vertical view is located on the platform to detect the upper end face. After taking the picture, vision machines receive the image and perform defect detection. Then, all detection results are sent to the host computer. Finally, when the magnetic ring reaches the sorting device, the qualified and unqualified magnetic rings are separated.

Software Design

13Based on the system hardware, the software of the proposed system is developed on the MFC and OpenCV platforms. If any defect is found, the software will mark and output the defect's height measurement results. It includes four modules, which are the camera control module, interactive interface module, magnetic ring defect detection module, and detection result communication and storage module. The camera control module mainly performs tasks such as camera control, camera status feedback, camera parameter setting, camera mode selection, image storage buffering and release. The interactive interface module is in charge of the interaction between the user and the system, including the camera control area, real-time image display area, result display area, threshold selection area and magnetic ring-type selection area. The defect detection module integrates all the methods proposed in the paper and takes charge of real-time detection and marking of images. The detection result communication and storage module adopts the serial communication mode and completes the transmission task of the defect detection result from the vision machine to the upper computer. The software runs on six visual machines. The interactive interface and defect detection modules of different visual machines are adjusted according to the installation position of the camera, the number of cameras and the characteristics of the magnetic ring image. However, the software framework and operating procedures are the same for each machine. The flow chart of software operation is shown in Figure 5, and the interactive interface can be seen in Figure 6.

14Sensors 2020, 20

15Based on the system hardware, the software of the proposed system is developed on the MFC and OpenCV platforms. If any defect is found, the software will mark and output the defect's height measurement results. It includes four modules, which are the camera control module, interactive interface module, magnetic ring defect detection module, and detection result communication and storage module. The camera control module mainly performs tasks such as camera control, camera status feedback, camera parameter setting, camera mode selection, image storage buffering and release. The interactive interface module is in charge of the interaction between the user and the system, including the camera control area, real-time image display area, result display area, threshold selection area and magnetic ring-type selection area. The defect detection module integrates all the methods proposed in the paper and takes charge of real-time detection and marking of images. The detection result communication and storage module adopts the serial communication mode and completes the transmission task of the defect detection result from the vision machine to the upper computer.

16The software runs on six visual machines. The interactive interface and defect detection modules of different visual machines are adjusted according to the installation position of the camera, the number of cameras and the characteristics of the magnetic ring image. However, the software framework and operating procedures are the same for each machine. The flow chart of software operation is shown in Figure 5, and the interactive interface can be seen in Figure 6. Figure 5. Flowchart of the software system.

Methods

17This section presents the details of the proposed approach for magnetic ring defect detection. The proposed methods include image preprocessing, IERA, MRLA, connected domain filtering method and the final part to measure the height of magnetic rings. The preprocessing step segments the suspected defect area with IERA and MRLA. Eventually, connected domain filtering identifies defects by analyzing morphological features. The details are as follows.

Image Preprocessing

18The defects to be detected on the surface include cracks, pits, adhesions, foreign matters, fibers, etc. Aimed at simplifying the detection problem, all defects are categorized into three categories, which are crack, fiber and large-area defects. Meanwhile, due to inherent problems with the system hardware, positioning error and uneven illumination will occur in magnetic ring images.

19To eliminate the unnecessary information and extract the key features in the image, a series of image preprocessing steps is performed. Figure 7 depicts the process of image processing. It is noticed that the gray-level and gradient defect features should be extracted separately in the preprocessing stage as the basis. Firstly, after extracting the ROI (region of interest) region of the input image, Otsu's [19] method is used to compute the gray threshold. Then, MRLA is used to calculate the position of the magnetic ring, solving the problem of positioning error. Subsequently, on the one hand, we perform sub-region gray threshold segmentation [20] to solve the uneven illumination problem and use IERA to acquire gray-level defect images. On the other hand, the Sobel operator is used to perform the gradient calculation. Finally, IERA is utilized to obtain the gradient image of defects.

20The magnetic ring appears as a curved surface in the image. The middle area of images is dark and the areas at both ends are bright due to the designed lighting system and the location of the camera (Figure 8h). To solve this uneven illumination problem, as mentioned above, sub-region gray threshold segmentation is performed. First, Otsu's method computes an optimal threshold that minimizes the intra-class variance. Suppose p i is the percentage of pixels with value i. The threshold T is computed according to Equation (1).

21According to the illumination performance, the target magnetic ring in the image is divided into i regions. The threshold value T i of the i − th region is defined by Formula (4).

22The threshold decay term D i is obtained through experiments. Suppose H is a grayscale image and G stands for the image after thresholding. The i − th region is binarized using Formula (5). An example is shown in Figure 8d. To prove the stability of the used image preprocessing method in relation to illumination, we change the illumination conditions (see Figure 9a,d) and conduct experiments with all other conditions being equal. The results confirm that the method has good robustness to illumination. This section presents the details of the proposed approach for magnetic ring defect detection. The proposed methods include image preprocessing, IERA, MRLA, connected domain filtering method and the final part to measure the height of magnetic rings. The preprocessing step segments the suspected defect area with IERA and MRLA. Eventually, connected domain filtering identifies defects by analyzing morphological features. The details are as follows.

23The defects to be detected on the surface include cracks, pits, adhesions, foreign matters, fibers, etc. Aimed at simplifying the detection problem, all defects are categorized into three categories, which are crack, fiber and large-area defects. Meanwhile, due to inherent problems with the system hardware, positioning error and uneven illumination will occur in magnetic ring images.

24To eliminate the unnecessary information and extract the key features in the image, a series of image preprocessing steps is performed. Figure 7 depicts the process of image processing. It is noticed that the gray-level and gradient defect features should be extracted separately in the preprocessing stage as the basis. Firstly, after extracting the ROI (region of interest) region of the input image, Otsu's [19] method is used to compute the gray threshold. Then, MRLA is used to calculate the position of the magnetic ring, solving the problem of positioning error. Subsequently, on the one hand, we perform sub-region gray threshold segmentation [20] to solve the uneven illumination problem and use IERA to acquire gray-level defect images. On the other hand, the Sobel operator is used to perform the gradient calculation. Finally, IERA is utilized to obtain the gradient image of defects. The magnetic ring appears as a curved surface in the image. The middle area of images is dark and the areas at both ends are bright due to the designed lighting system and the location of the camera (Figure 8h). To solve this uneven illumination problem, as mentioned above, sub-region gray threshold segmentation is performed. First, Otsu's method computes an optimal threshold that minimizes the intra-class variance. Suppose i p is the percentage of pixels with value i .

25The threshold T is computed according to Equation (1).

Magnetic Ring Location Algorithm

26For the sake of carrying out accurate inspection, the position of the magnetic ring should be determined quickly. On account of the hardware, the position of the magnetic ring is unfixed in the system and the location migration occurs mainly in one direction. To solve the problem, MRLA (see Algorithm 1) is proposed to calculate the position of the magnetic ring in the image. Figure 8b shows examples of torus image location results.

27As for end face images, Algorithm 1 is adopted to acquire the top position top, and the bottom position bot. Suppose T l is the positioning threshold. Then, in step 5, the scanning direction is changed to left-to-right. Finally, the left position le f t and the right position right are obtained. Let Center(x, y) denote the magnetic ring center position, whereas x = (le f t + right), and y = (top + bot)/2. An example is shown in Figure 10e.

Image Edge Removal Algorithm

28In the image preprocessing procedure, it is found that gradient binary images and grayscale images contain the inner edge contour (IEC) of the upper end face, the outer edge contour (OEC) of the upper end face, and the lower edge contour (LEC) of the magnetic ring, as shown in Figure 8a. These edges will interfere with the subsequent defect filtering. To better isolate defects from images, IERA is proposed to eliminate these edges.

29The edge of the magnetic ring behaves differently in different kinds of pictures. To extract the defect features of different surfaces, IERA is divided into three parts. Algorithm 2 Part I, Part II and Part III describe IERA for torus grayscale images, torus gradient images and end face binary images, respectively. Figure 8c-g shows the process of IERA. By means of Algorithm 2 Part I, torus gray binary images after removing the upper end face are shown in Figure 8e. To illustrate the algorithm, a sketch is shown in Figure 11.

30Sometimes, defects, such as recessive cracks and fibers, are inconspicuous in gray binary images. However, they could be easily observed in gradient binary images. By using Algorithm 2 Part II, the edge-removed torus gradient image can be obtained (see Figure 8g). Besides, according to the imaging characteristics of the end face of magnetic rings, through Algorithm 2 Part III, we can obtain the edge-removed end face image (see Figure 10c). Furthermore, after sub-region gray threshold segmentation, an edge-removed end face binary image with defect features is shown in Figure 10d. (Center(x, y), (Top + Bot), w 1 ) as its center, radius and line width, respectively. 4: for j = y, y − 1, . . . ,4 do 5: Scan upward from Center(x, y). Get R 2 = y − j. 8: end 9: end 10: Create a white circle C 2 with (Center(x, y), R 2 , w 1 ) as its center, radius and line width, respectively. 11: Use C 1 and C 2 to remove edges. 12: Output the edge-removed grayscale end face image.

31In the image preprocessing procedure, it is found that gradient binary images and grayscale images contain the inner edge contour (IEC) of the upper end face, the outer edge contour (OEC) of the upper end face, and the lower edge contour (LEC) of the magnetic ring, as shown in Figure 8a. These edges will interfere with the subsequent defect filtering. To better isolate defects from images, IERA is proposed to eliminate these edges.

32The edge of the magnetic ring behaves differently in different kinds of pictures. To extract the defect features of different surfaces, IERA is divided into three parts. Algorithm 2 Part I, Part II and Part III describe IERA for torus grayscale images, torus gradient images and end face binary images, respectively. Figure 8c-g shows the process of IERA. By means of Algorithm 2 Part I, torus gray binary images after removing the upper end face are shown in Figure 8e. To illustrate the algorithm, a sketch is shown in Figure 11.

33i-th row Figure 11. Sketch of the image edge removal algorithm.

34Sometimes, defects, such as recessive cracks and fibers, are inconspicuous in gray binary images. However, they could be easily observed in gradient binary images. By using Algorithm 2 Part II, the edge-removed torus gradient image can be obtained (see Figure 8g). Besides, according to the imaging characteristics of the end face of magnetic rings, through Algorithm 2 Part III, we can obtain the edge-removed end face image (see Figure 10c). Furthermore, after sub-region gray threshold segmentation, an edge-removed end face binary image with defect features is shown in Figure 10d.

Connected Domain Filtering Method

35After preprocessing, the remaining connected components represent the potential defect areas. As the size and shape of defect should meet certain conditions to be mechanically significant, the connected components are further filtered by thresholds [21]. In accordance with statistics, the specific characteristics of the three types of defects are as follows:

•

36Crack defect: It can be categorized into obvious crack and recessive crack. The obvious crack is shown as a thick line in the image and has a strong contrast with the torus region. The recessive crack is opposite to the obvious crack. • Large-area defect: It is characterized by obvious protrusion or depression, a strong contrast with the surrounding area and a large defect area. • Fiber defect: It has the characteristics of low gray-level discrimination with the surrounding area, inconspicuous protrusion, irregular shape, and fine lines.

37For obvious cracks in contact with the end face of the magnetic ring, detection is performed by scanning the upper edge array Top[i] to detect the curvature transition point [22]. Let T q denote the curvature threshold. If Formula (6) is satisfied, a crack defect is found.

38Large-area defects and the rest of the obvious cracks have common characteristics, such as large contrast with normal torus, obvious morphological features in binary images, and large area of connected domains. So, same method based on connected domain filtering is used to solve the two similar problems (see Algorithm 3 Part I below). Let us define the minimum bounding rectangle T (with length H and width W) of the connected domain. Let T wh denote the length and width ratio threshold of the connected domains and R wh denote the ratio of the connected domain to the area of its minimum bounding rectangle. T h and T w represent the length threshold and the width threshold of T, respectively. Finally, suppose the threshold of the area of connected domains is denoted by T s .

Algorithm 3 Connected Domain Filtering Method

39Part I 1: Give a gray binary image G d or a gradient binary image G w . 2: Process and get G d 's anti-color image G dc . 3: Get the connected domain set Q and the number k of the connected domain. 4: for i = 1, . . . , k do

5:

40Get the area S i of the connected domain Q i ∈ Q, the minimum bounding rectangle T i (with length H i and width W i ). 6: Set each value of (T wh , R wh , T h , T w , T s ). 7: if condition is satisfied 8:

41Q i is judged to be a defect. 9: end 10: end 11: Output the results.

42Part II 1: Given a gradient binary image G w . 2: Get the width W of G w .

3:

43Set the step length step and a rectangular search box Sbox with a width of w b and a length of h b . Set number of connected domains N i = 0. 4: for i = 1, . . . w b + i * step, . . . , W do 5:

44Use Sbox to traverse G w from top to bottom in steps of step.

6:

45For the i − th Sbox, get k connected domains. 7:

46for j = 1, . . . , k do

8:

47Get the area S j of the connected domain Q j ∈ Q, the minimum bounding rectangle T j (with length H i and width W j ). 9:

48Set each value of (T wh , R wh , T h , T w , T hs , T ss ). 10: if condition1 is satisfied. 11:

49N i + = 1 and save the coordinate of the connected domain (x j , y j ). With regard to obvious cracks, the connected domain is represented as a thick straight line (see Figure 12c). For the connected domain and its minimum bounding rectangle, by extensive experiments, we define that if conditions, such as H > T h , W < T w , H/W > T wh and S/(W × H) > R wh , are satisfied, connected domains are identified as obvious cracks. So, the filter criterion condition can be expressed as (7).

50For large-area defects, connected domains are characterized by large, irregular shapes (see Figure 12a). On the basis of statistics, it is defined that if conditions, such as H > T h , W > T w , H/W > T wh and S/(W × H) > R wh , are satisfied, connected domains can be defined as large-area cracks. So, the filter criterion condition can be expressed as (8).

51Fiber defects and recessive crack defects do not have strong contrast with normal torus. In binary images, they appear as several small connected domains distributed in a certain region. Therefore, these two defects are filtered according to the characteristics of connected domains and the relationship between connected domains. Let T n denote the number threshold of the connected domain in the search box. T hs represents the width sum threshold of the connected domain, and T ss delegates the area sum threshold of the connected domain.

52cracks. So, the filter criterion condition can be expressed as (8).

53Fiber defects and recessive crack defects do not have strong contrast with normal torus. In binary images, they appear as several small connected domains distributed in a certain region. Therefore, these two defects are filtered according to the characteristics of connected domains and the relationship between connected domains. Recessive cracks appear (Figure 12b) as several disconnected lines in the processed binary image. For example, Figure 12b describes a recessive crack and its made up of three line segments. Like the obvious crack, in Algorithm 3 Part II, the filter criterion 1 condition is expressed as condition (9) to identify whether the segments are part of a crack defect. Furthermore, what really matters is the relationship between the segments. Recessive cracks appear (Figure 12b) as several disconnected lines in the processed binary image. For example, Figure 12b describes a recessive crack and its made up of three line segments. Like the obvious crack, in Algorithm 3 Part II, the filter criterion condition1 is expressed as condition (9) to identify whether the segments are part of a crack defect. Furthermore, what really matters is the relationship between the segments. H j , the sum of the minimum bounding rectangle length of adjacent connected domains in a search box Sbox, is selected as the filtering criterion. Through extensive experiments, we define that if conditions N i >= T n and H j ≥ T hs are satisfied, Sbox is determined to contain a recessive crack. So, replacing condition2 with condition (10), the method can detect the recessive crack correctly.

54Fiber defects appear as several irregularly disconnected connected domains in the processed binary image (see Figure 12d). In the first place, condition (11) is introduced to take the place of condition1 to identify whether connected domain Q j is part of a fiber. Subsequently, by extensive experiments, it is found that the sum S j of the connected domain area is more useful in defect detection than the sum H j of minimum bounding rectangle length. Thus, the filter criterion condition2 is expressed as (12).

Measurement Method of Magnetic Ring Height

55In addition to defect detection, height measurement is also an important target of this system. In the magnetic ring height image, the glass wheel's area is fixed (see Figure 13b) and can be removed by setting the fixed area of the grayscale image to white (see Figure 13c). Then, MRLA is used to calculate the position of the magnetic ring and get the upper position up and lower position down. Subsequently, the pixel height of the magnetic ring height = down − up is obtained. and O denote the lens center of the camera. V presents the image distance from the light center to the image plane, and Z defines the distance from the object to the image plane. From the triangle similarity principle, we can obtain:

56is fitted through experiments, and y height = is substituted into Formula (13) to obtain the actual height of the magnetic ring. Through practical verification, ultimately, the precision of height measurement is about 0.02 mm.

Examples of Defect Detection

57All the proposed algorithms and methods are applied to the magnetic ring detection system. Then, we perform some experiments to check the operation of the system. According to the manufacturing process, we find that crack and fiber defects mainly appear in the inner and outer ring surfaces. Hence, we can detect them from the inner and outer ring surfaces. It is noteworthy that According to the imaging principle of the camera, the spatial position measurement diagram of the target vertical direction in the image is shown in Figure 13a. Let π denote the imaging plane and O denote the lens center of the camera. V presents the image distance from the light center to the image plane, and Z defines the distance from the object to the image plane. From the triangle similarity principle, we can obtain:

58Formula (Z − V)/V is fitted through experiments, and y = height is substituted into Formula (13) to obtain the actual height of the magnetic ring. Through practical verification, ultimately, the precision of height measurement is about 0.02 mm.

59All the proposed algorithms and methods are applied to the magnetic ring detection system. Then, we perform some experiments to check the operation of the system. According to the manufacturing process, we find that crack and fiber defects mainly appear in the inner and outer ring surfaces. Hence, we can detect them from the inner and outer ring surfaces. It is noteworthy that various kinds of large-area defects will appear on the outer ring and the end face, and the large-area defect on the inner ring is an adhesion defect.

60The results are shown below, including magnetic ring height (Figure 13d), fiber defects ( Figure 14), crack defects ( Figure 15) and large-area defects ( Figure 16). For different defects located on different surfaces, the system can accurately judge whether it is a defect and mark the position. various kinds of large-area defects will appear on the outer ring and the end face, and the large-area defect on the inner ring is an adhesion defect. The results are shown below, including magnetic ring height (Figure 13d), fiber defects ( Figure 14), crack defects ( Figure 15) and large-area defects ( Figure 16). For different defects located on different surfaces, the system can accurately judge whether it is a defect and mark the position.

Statistical Results of Defect Detection

61In the system, visual machines are equipped with an Intel Core i5-5350U CPU 1.8 GHz processor with 2-GB RAM, and the host computer is equipped with an Intel Core i5-4590 3.3 GHz processor with 4-GB RAM. The experimental results are evaluated by two sub-tasks. One is to evaluate how fast the image processing is (efficiency), and the other is to assess the capability of the algorithm in detecting defect images (accuracy). For the sake of testing the speed of the system, in the experiment, 2400 magnetic rings are continuously detected and the execution time of each vision machine is calculated. As shown in Table 1, for different vision machines, it can be found that the maximum detection time of a single magnetic ring is 510 ms, and the maximum average detection time is 455 ms. In other words, the proposed detection system eventually reaches an average detection speed of about 120 pcs/min.

62For the second sub-task, in order to test the system accuracy for various defects' detection, we select 200 magnetic rings for each type of defect and test them. Table 2 demonstrates the statistical results. By counting the results of various defects' detection, it can be concluded that the accuracy for crack and large-area defects, such as adhesion, hanger adhesion and pitting, reaches 100%. Meanwhile, the accuracy for foreign matters and fibers achieves 92.5% and 91.5%, respectively. From the results, it is confirmed that the proposed method and system possess good performance. Both the accuracy and the speed are suitable for magnetic ring real-time online inspection in the automated production line.

63In the system, visual machines are equipped with an Intel Core i5-5350U CPU 1.8 GHz processor with 2-GB RAM, and the host computer is equipped with an Intel Core i5-4590 3.3 GHz processor with 4-GB RAM. The experimental results are evaluated by two sub-tasks. One is to evaluate how fast the image processing is (efficiency), and the other is to assess the capability of the algorithm in detecting defect images (accuracy). For the sake of testing the speed of the system, in the experiment, 2400 magnetic rings are continuously detected and the execution time of each vision machine is calculated. As shown in Table 1, for different vision machines, it can be found that the maximum detection time of a single magnetic ring is 510 ms, and the maximum average detection time is 455 ms. In other words, the proposed detection system eventually reaches an average detection speed of about 120 pcs/min.

64For the second sub-task, in order to test the system accuracy for various defects' detection, we select 200 magnetic rings for each type of defect and test them. Table 2 demonstrates the statistical results. By counting the results of various defects' detection, it can be concluded that the accuracy for crack and large-area defects, such as adhesion, hanger adhesion and pitting, reaches 100%. Meanwhile, the accuracy for foreign matters and fibers achieves 92.5% and 91.5%, respectively. From the results, it is confirmed that the proposed method and system possess good performance. Both the accuracy and the speed are suitable for magnetic ring real-time online inspection in the automated production line.

Conclusions

65In this paper, we propose a defect detection system for magnetic rings and adopt advanced multi-camera vision technology. The system includes two efficient image processing algorithms, which are IERA and MRLA. By using the detection method for cracks, fibers and large-area defects based on connected domain filtering, it solves the difficult defect detection problem for three-dimensional magnetic rings with high speed and precision. The experiment results demonstrate that machine vision can substitute most of the manual operations in magnetic ring defect detection, greatly improving the production efficiency and the automation degree.

66In the developed system, the hardware platform and software system are studied and designed in depth, and the final developed system is experimentally verified. Compared with existing systems, the current system has more comprehensive functions and a good integration degree. The device and method have a high detection precision, can realize real-time online detection of three-dimensional magnetic rings, and can be widely applied in magnetic ring production.

67Author Contributions: All authors contributed extensively to the work presented in this paper and wrote the manuscript. X.Z. provided technical guidance and wrote the initial version of the paper. W.G. instructed the software and the whole development. X.X. conducted the investigation and gave guidance. All authors have read and agreed to the published version of the manuscript.

참고문헌 19건

  1. Extracting crack signal of magnetic ring based on MAX262 Proceedings of SPIE, the International Society for Optical Engineering/Proceedings of SPIE · SPIE · 2013 10.1117/12.2014634
  2. Multiscale image quality measures for defect detection in thin films The International Journal of Advanced Manufacturing Technology · Springer Science+Business Media · 2015 10.1007/s00170-014-6758-7
  3. Automated visual classification of frequent defects in flat steel coils The International Journal of Advanced Manufacturing Technology · Springer Science+Business Media · 2011 10.1007/s00170-011-3352-0
  4. A Visual Detection System for Rail Surface Defects IEEE Transactions on Systems Man and Cybernetics Part C (Applications and Reviews) · Institute of Electrical and Electronics Engineers · 2012 10.1109/tsmcc.2012.2198814
  5. Identification of defects on highly reflective ring components and analysis using machine vision The International Journal of Advanced Manufacturing Technology · Springer Science+Business Media · 2010 10.1007/s00170-010-2730-3
  6. A study of internal defect testing with the laser-EMAT ultrasonic method IEEE Transactions on Ultrasonics Ferroelectrics and Frequency Control · Institute of Electrical and Electronics Engineers · 2012 10.1109/tuffc.2012.2511
  7. A Threshold Selection Method from Gray-Level Histograms IEEE Transactions on Systems Man and Cybernetics · Institute of Electrical and Electronics Engineers · 1979 10.1109/tsmc.1979.4310076
  8. Research on surface defect inspection for small magnetic rings International Conference on Mechatronics and Automation · 2009 10.1109/icma.2009.5246333
  9. Surface Crack Detection for Carbon Fiber Reinforced Plastic (CFRP) Materials Using Pulsed Eddy Current Thermography IEEE Sensors Journal · IEEE Sensors Council · 2011 10.1109/jsen.2011.2157492
  10. A real-time vision system for defect inspection in cast extrusion manufacturing process The International Journal of Advanced Manufacturing Technology · Springer Science+Business Media · 2008 10.1007/s00170-007-1326-z
  11. Defect detection of polycrystalline solar wafers using local binary mean The International Journal of Advanced Manufacturing Technology · Springer Science+Business Media · 2015 10.1007/s00170-015-7498-z
  12. Review on the machine vision measurement and control technology for intelligent manufacturing equipment Control theory & applications · South China University of Technology · 2015
  13. Study on the defect inspection algorithm of touch switch pins based on machine vision Journal of Zhejiang University of Technology · Zhejiang University of Technology · 2015
  14. A Machine Vision Apparatus and Method for Can-End Inspection IEEE Transactions on Instrumentation and Measurement · Institute of Electrical and Electronics Engineers · 2016 10.1109/tim.2016.2566442
  15. Automatic Microstructure Defect Detection of Ti-6Al-4V Titanium Alloy by Regions-Based Graph IEEE Transactions on Emerging Topics in Computational Intelligence · Institute of Electrical and Electronics Engineers · 2017 10.1109/tetci.2017.2669523
  16. Machine Vision-Based Positioning and Inspection Using Expectation–Maximization Technique IEEE Transactions on Instrumentation and Measurement · Institute of Electrical and Electronics Engineers · 2017 10.1109/tim.2017.2717284
  17. Defect Detection in Cylindrical Cavity by Electromagnetic Ultrasonic Creeping Wave IEEE Transactions on Magnetics · IEEE Magnetics Society · 2017 10.1109/tmag.2017.2759121
  18. Fast Eddy Current Testing Defect Classification Using Lissajous Figures IEEE Transactions on Instrumentation and Measurement · Institute of Electrical and Electronics Engineers · 2018 10.1109/tim.2018.2792848
  19. Detection of Slit Defects on Backside of Steel Plate Using Low-Frequency Eddy-Current-Testing 2018 IEEE International Magnetics Conference (INTERMAG) · 2018 10.1109/intmag.2018.8508192