Journal of Robotics, Networking and Artificial Life
Vol. 7(3); December (2020), pp. 212–216
DOI: https://doi.org/10.2991/jrnal.k.200909.015; ISSN 2405-9021; eISSN 2352-6386
https://www.atlantis-press.com/journals/jrnal

Research Article

Detection Algorithm of Porosity Defect on Surface ofMicro-precision Glass Encapsulated Electrical Connectors
Qunpo Liu1,*, Manli Wang1, Gaowei Wang1, Ruxin Gao1, Naohiko Hanajima2
Department of Robotics Engineering, Henan Polytechnic University, 2001 Century Avenue, Jiaozuo, Henan 454003, P. R. China
College of Information and Systems, Muroran Institute of Technology, 27-1 Mizumoto-cho, Hokkaido, Muroran-shi, Hokkaido 050-8585, Japan12ARTICLE INFOABSTRACT

Article History

A miniature precision glass encapsulated electrical connectors introduced by glass powder and metal wires through a special
complicated process. Aiming at the porosity defects on the surface, a defect detection algorithm propose based on thresholdsegmentation and feature extraction. Pre-operation, global threshold segmentation processing and feature extraction (based onarea, circularity aspect ratio, compactness, and contour length) are preformed to detect the defects. Experimental results showthat the algorithm can accurately identify porosities defects.

Received 15 October 2019
Accepted 13 June 2020
Keywords
Micro-precision glass encapsulated
electrical connectors
manual inspection
surface defect inspection
feature extraction© 2020 The Authors. Published by Atlantis Press B.V.
This is an open access article distributed under the CC BY-NC 4.0 license (http://creativecommons.org/licenses/by-nc/4.0/).

1. INTRODUCTION
The micro-precision glass encapsulated electrical connectors
is mainly used to connect a module, fix its wires and insulate itfrom the “tube shell”, as shown in Figure 1. The glass encapsulated
electrical connector structure is composed of three parts: the connector, the high-temperature glass layer, and the low-temperature
glass layer in order from the inside. Due to the low density of the
low-temperature glass layer on the outside of the electrical connector, which is fluffy, and the material contains lead, the operating
temperature during the sealing process is abnormal (such as toohigh or too low), and the accuracy of the equipment is not highor malfunctions. As a result, part of the surface structure of thelow-temperature glass layer is not compact enough, thereby causing porosity and crack defects. Therefore, the detection of porosity and crack defects on the surface of glass encapsulated electricalconnectors is mainly the detection of defects at the low temperature
glass welded to the outside. This article is mainly concerned withporosity defect.
The glass encapsulated electrical connector has a small volume(about 2.85 mm in diameter) and requires high accuracy (<0.01mm). At present, the detection of defects such as porosities andcracks on the surface of the glass encapsulated electrical connector achieve manually by combining with a magnifying glass.
However, people who work for a long time are prone to eye fatigue
and labor intensity [1]. There are too many subjective factors
during manual inspection. Over-fatigue caused by high-intensity
work and fast inspection speed may lead to missed inspection orfalse inspection. As a result, the defective encapsulated electrical
Corresponding author. Email: lqpny@hpu.edu.cn*

connector assembly applied, resulting in poor or even unusable
product quality and need to rework, causing huge economic losses.
In addition, glass encapsulated electrical connectors are in great
demand in some respects and show expansive growth. However,
the automatic detection of porosity defects on the surface of connectors at home and abroad is still blank. Therefore, the automatic
detection of porosities defects on the surface of glass encapsulated
electrical connectors has become a major problem that needs tosolve urgently.
For the research of surface defect detection, the Wang et al. [2],Mei et al. [3] and so on use deep learning or support vector machine
to detect the surface defect of the object, but the calculation time islong and the sample demand is large. The Chen et al. [4], Wanget al. [5] conducts defect detection by extracting features such as
geometric features of defect areas on the surface of objects, andthen identifies and classifies the defects. The method is simple,
fast and practical. Based on the characteristics of porosity defects
on the surface of glass encapsulated electrical connectors, a defectdetection of surface algorithm for micro-precision glass insulated
encapsulated electrical connectors based on threshold segmentation and feature extraction was proposed.

2. DETECTION ALGORITHM
BASIC STRUCTURE
The algorithm uses Halcon HDevelop (18.11) to perform pre-­processing operations such as background removal, and G channel acquisition of the image with defects. Then, these two defects
are detected using global threshold segmentation processing andfeature extraction methods based on area, circularity, aspect ratio,

Q. Liu et al. / Journal of Robotics, Networking and Artificial Life 7(3) 212–216

abFigure 1 | Glass terminal and its installation. (a) Glass terminal
installation. (b) The micro-precision glass encapsulated electricalconnectors.

a213

b

Figure 2 | The removal result of background. (a) Stomatal defect sample.
(b) Background removal of the sample.

compactness, and contour length, and the characteristic parameters of the defect area are calculated and analyzed. Finally, theclassification is based on the difference between the porosity andcrack defect characteristics, and the specific process is image pre-­processing, defect detection, feature parameter analysis, and finalclassification decision.

3. IMAGE PRE-PROCESSING
3.1. Background Removal
The pictures acquire with an image-measuring instrument andthe colored image is 640 × 480.
In order to facilitate defect detection, it is necessary to separate theend surface area of the glass encapsulated electrical connector fromthe background to reduce the interference. Since blue does not occur
naturally in glass encapsulated electrical connectors and is one of thethree channels in the RGB color space, it is easier to segment theforeground area from a blue background than other colors [6]. Inorder to verify the feasibility of this method from the aspect of practical application, and use a large number of samples with different
colors for experimental verification and theoretical analysis. By manually changing the background to ten common colors such as black,gray, white, red, orange, yellow, green, cyan, blue, and purple, theexperimental verification and comparative analysis of glass encapsulated electrical connector defect samples were performed. In order tomeet the requirements of practical applications, dope the backgroundcolor appropriately, and it finally find that when the backgroundis biased to pure blue, it can completely meet the requirements ofremoving the main background. In addition, because the color of theupper-left character of the collected picture is green, which is different from the main background blue color. It is necessary to fill thecharacter area (that is, the area from the image origin to one-sixth
long and one-third wide) to the purpose of process of backgroundwhich include color image to Hexcone Model (HSV) space, blue
threshold mask and bitwise negation to generate the target areamask, make the original image and itself bitwise operate in thetarget area mask, character area color fill. The removal result isshown in Figure 2. Where, the range of values of H, S, and V whengenerating mask in Figure 2 is: H: [100, 124], S: [43, 255], V: [46, 255].

Figure 3 | G channel for extracting defective samples.

implementation, it is often necessary to convert color images intograyscale images for processing. For the convenience of detection,
the three-channel color image is converted into six single-channelgrayscale images of R, G, B, H, S, and I. After testing and observation, it is found that the defect part of the glass channel of the Gchannel is more obvious, so the image of the G channel is selected
as the detection map, and the G channel of the glass encapsulated
electrical connector is shown in Figure 3.

4. DEFECT DETECTION
The porosity defect on the surface of the glass encapsulated electrical connector are more clearly identified by color, and gray value
is lower than other surrounding areas, and they are approximately
black. Therefore, global threshold segmentation and feature-based
detection and recognition methods use for the detection ofporosity defects.

4.1. Threshold Segmentation
Global threshold segmentation perform on the pre-processed glass
encapsulated electrical connector image. The threshold segmentation is shown in Eq. (1).
Gmin £ g (x , y ) £ Gmax 		  (1)3.2. Obtaining the Glass EncapsulatedElectrical Connector G Channel

where, g(x, y) is the gray-value of the image, Gmin and Gmax is theminimum pixel value (15 here) and the maximum pixel value(35 here). That is, the area formed by the gray-value of the image
between the minimum pixel value and select the maximum pixel
value in the image as the defect area to select.

During the implementation of detection technology of machine
vision, due to the requirements of detection speed and algorithm

After the above color feature processing, the detection range ofglass encapsulated electrical connector defects can reduce, andQ. Liu et al. / Journal of Robotics, Networking and Artificial Life 7(3) 212–216

214

the distribution of suspicious defects can be roughly determined.
Then, the defect area can be detected by the geometric features ofthe defects. The segmentation result is shown in Figure 4.

where, Ra and Rb are the major and minor axes of the circumscribed
ellipse, respectively.

4.2.4. Tightness of defects

4.2. Detection and Identification of
Defect Geometric Features
According to the distribution of suspicious defects of the glass
encapsulated electrical connector, finally determining the porosity
defect also requires multiple features for detection and identification. Common defect features in defect detection are area, circularity, perimeter, length, width, ratio of major axis to minor axis,
defect center of gravity, circular or stripe defects, average grayscaleand contrast, etc. This article mainly uses area, circularity, aspectratio and compactness for feature selection.

Tightness is a form factor that represents the tightness of a region.
The tightness of the circle is 1, if the area is long, the shape factor isgreater than 1, and the longer the shape factor, the larger the shapefactor, as shown in Eq. (5).
2			 Ct = L 
4pAs

(5)

where, L is the outline length of the area.

4.2.5. Defect contour length
4.2.1. Defect area
The area of a defect can be simply defined as the number of pixels
contained in the boundary of the defect, which is only related to thesize of the target area, and has nothing to do with the gray-value ofthe pixels at each point. The area is determined as shown in Eq. (2).		  
As = å f (x , y ) (2)( x , y )Î s

where, s is the target area, f(x, y) is pixel value, As is object area.

It can be defined as the ratio of the area to the maximum area, as
shown in Eq. (3).
As

2
pdmax

(3)

where, dmax is the maximum distance from the defect center to thearea boundary.

The aspect ratio refers to the ratio of the major axis to the minor
axis of the circumscribed ellipse of the region, as shown in Eq. (4).
Ra
RbThe glass encapsulated electrical connector defect detection results
are shown in Figure 5.

5. EXPERIMENT AND RESULTS
In order to verify the feasibility of the algorithm, three samples
with defects were randomly selected for experiments, as shownin Figure 6.
Table 1 | Ranges of characteristic values of porosity defects

4.2.3. Aspect ratio of defects			 Rt =4.2.6. The characteristic values
for identification
The characteristic values of feature detection and identification ofstomatal defect are shown in Table 1.

4.2.2. Roundness of defects			 C =The contour length refers to the total length of the contour line at
the boundary of the specified area, that is, the sum of the distancesof the pixels on the edge of the contour. Among them, the distance
between two adjacent contour points parallel to the coordinate axis
is 1, and the distance on the diagonal is 2.

(4)

Figure 4 | Threshold segmentation map (red area is a suspected defect area).

Defect typeAs (mm )CRtCtContour length (mm)2Porosity[0.0015, 0.05][0.25, 1][1.0, 1.6]
[1.0, 2.0]
[0.05, 0.60]

Figure 5 | Defect detection results (red areas are defects).

Q. Liu et al. / Journal of Robotics, Networking and Artificial Life 7(3) 212–216

abcdef215

based on threshold segmentation and feature extraction is proposed
based on the characteristics of the abnormal texture of the end
surfaces. The background is removed by image pre-processing,and the defect can be obtained by threshold segmentation. Then,through the characteristics of area, roundness, aspect ratio, tightness, and contour length, the detection of porosity defects on
the surface is realized. Laid the foundation for automatic quality
inspection and assembly.

CONFLICTS OF INTERESTghi

The authors declare they have no conflicts of interest.

ACKNOWLEDGMENTS
Figure 6 | Defect detection results. (a) Sample—S1. (b) Sample—S2.
(c) Sample—S3. (d) Defect area labeling in S1. (e) Defect area labelingin S2. (f) Defect area labeling in S3. (g) Defect—S1-p1. (h) Defect—S2-p1. (i) Defect—S3-p1 and S3-p2.
Table 2 | Characteristic values of porosity defects
Characteristic type

S1-p1

S2-p1

As (mm )CRt
Ct
Contour length (mm)7.7 * 10
0.53
1.21
1.62
0.18

21.1 * 10
0.67
1.13
1.28
0.24

2−3

S3-p1
−3S3-p2

38.2 * 10
0.37
1.25
1.86
0.26

−3

15.4 * 10−3
0.68
1.05
1.46
0.21

The characteristic values of defects in experiment samples areshown in Table 2.
As shown in Table 2, it can be seen from the experimental resultsthat the algorithm proposed in this paper can extract the porosity
defect areas. And it can identify porosity defects based on characteristic parameters of area, roundness, aspect ratio, tightness, andcontour length.

6. CONCLUSION
Based on the detection of porosities on the surface of glass encapsulated electrical connectors, a surface defect detection algorithm

This work is partially supported by National Key Research andDevelopment Project (2016YFC0600906), Innovation Scientists
and Technicians Troop Construction Projects of Henan Province(CXTD2016054) and also supported by Innovative Scientists
and Technicians Team of Henan Provincial High Education(20IRTSTHN019).

REFERENCES
[1]
[2]

[3]
[4]
[5]
[6]Z.T. Shen, J.P. Chen, H.D. Du, R. Li, Research and application ofinsulator RTV coating quality inspection method based on machinevision, Insulat. Surge Arresters 285 (2018), 239–246 (in Chinese).
T. Wang, Y. Chen, M. Qiao, H. Snoussi, A fast and robust convolutional neural network-based defect detection model inproduct quality control, Int. J. Adv. Manuf. Technol. 94 (2018),3465–3471.
S. Mei, H. Yang, Z. Yin, An unsupervised-learning-based
approach for automated defect inspection on textured surfaces,IEEE Trans. Instrum. Measure. 67 (2018), 1266–1277.
Y.Y. Chen, Y. Wang, H.X. Ye, H.T. Wu, Z.S. Cui, Research on thedefect detection of machine vision toughened glass insulator
bubble, Autom. Instrum. 31 (2010), 51–53+56 (in Chinese).
S.H. Wang, Y.G. Cai, H. Cai, Research on glass surface defectdetection algorithm, J. Dongguan Univ. Technol. 25 (2018),45–49 (in Chinese).
D. Zhang, D.J. Lee, B.J. Tippetts, K.D. Lillywhite, Date maturity
and quality evaluation using color distribution analysis and backprojection, J. Food Eng. 131 (2014), 161–169.

AUTHORS INTRODUCTION
Dr. Qunpo Liu

Mr. Manli Wang
He graduated from Muroran Instituteof Technology (Japan) with a PhD inProduction Information Systems. He is an
Associate Professor at Henan Polytechnic
University (China) and a Master’s tutor. He
is mainly engaged in teaching and research
work in special environment mobile robots,intelligent instruments and industrial automation equipment.

He received the B.S. degree in ElectricalEngineering and Automation from Henan
Polytechnic University and the M.S. degreein Control Theory and Control Engineeringfrom Henan Polytechnic University. His
research interests include image denoisingand image enhancement.

216

Q. Liu et al. / Journal of Robotics, Networking and Artificial Life 7(3) 212–216

Mr. Gaowei Wang

Prof. Naohiko Hanajima
He graduated from Henan PolytechnicUni­versity (China) in 2017 with a Bachelor’sdegree in Automation. He is currently
studying for a Master’s degree in Control
Engineering at Henan PolytechnicUni­versity. He is mainly engaged inresearch on machine vision.

Dr. Ruxin Gao
He graduated from Huazhong Universityof Science and Technology (China) with aPhD in Pattern Recognition and Artificial
Intelligence. Now he is an Associate
Professor at Henan Polytechnic University(China). He is mainly engaged in teaching
and research work in image processing,machine vision and artificial intelligence.

He graduated from the Hokkaido
University (Japan) of Technology in Japan
with a PhD. He is a Professor at the Collegeof Information and Systems at MuroranInstitute of Technology (Japan). He ismainly engaged in robotics and intelligent
equipment.