# Measuring the Positions of the Solder Pins of Electrical Connectors from the Side
## 1 Introduction  
Electrical connectors are the components used in electronic equipment or devices, such as mobile phones, computers, network equipment, and medical devices, for signal or power transmission. Through-hole-type connectors often need to be soldered onto the printed circuit boards (PCBs). For properly placing the connectors on the PCBs, the positions of the connectors' solder pins need to be made within the specification so that the solder pins can be fitted into the corresponding through holes on the PCBs without resistance. To make sure that the positions of the connectors' solder pins are within the specification, in addition to using visual inspection or gauges, the common practice in the electronics industry involves the use of the automated optical inspection (AOI) technique [1, 2], which uses industrial cameras to capture the images of the object that is subject to inspection. Then, it applies image processing to obtain the measurement results. Using AOI can save inspection time and reduce human errors [2, 3, 4]. Several researchers have studied the solder pins of ICs or connectors. For instance, [PERSON] and [PERSON] [5] measured from the bottom of a connector. Because the bottom surfaces of the solder pins reflected light unevenly, the images from the bottom became partially white and partially black after binarization. Subsequently, they used the proportion, position, and shape of the black and white parts of the images and conducted a neural network analysis to determine whether the pin positions were normal. Further, they used 18 samples to train neural networks, and the detection success rate reached 100%. [PERSON] et al. [6] used machine vision to detect the pins of the DIP IC from the side. First, edgedetection was performed to obtain the pin positions. After wavelet transformation, the spacing between the pins was obtained to determine whether the spacing was qualified. The system can only detect one side of the pins of the DIP IC at a time. [PERSON] [7] also applied the wavelet transform and discrete Fourier transform to recognize various IC pin patterns. [PERSON] et al. [8] proposed using a median filter to improve the Canny algorithm and remove the image noise along the edge of the IC pin. On the other hand, to increase detection efficiency, [PERSON] et al. [9] used mirror reflection to detect both sides of the pins simultaneously. [PERSON] et al. [10] also used a mirror set to detect the flatness of the SMT pins on both sides of the IC. The flatness-detection error of the system can be less than 4 \(\upmu\)m. In addition, [PERSON] et al. [11] also used an object feature-matching algorithm to find the pin end faces and then took their center points, representing the pin's position. [PERSON] et al. [12] placed the connector's terminals on top of the backlight, allowing a camera to capture the terminals' image from the top. Subsequently, they performed Gaussian filtering and Canny edge detection to determine the spacing between terminals. Some researchers used two cameras to capture images in stereo vision. For instance, [PERSON] et al. [13] used dual cameras with the centroid method to measure the pins, obtained the pins' bright spots from the end of the pins, and rebuilt the 3D structure of the pins to obtain the height of each pin. The experimental results showed that of the 19 pins tested, the maximum difference between the results obtained and the contact measurement method was 3.7%. [PERSON] and [PERSON] [14] also adopted dual camera detection. They used high dynamic range (HDR) technology to deal with the uneven brightness problem. HDR uses different exposure times to capture images. Combining several images with low exposure and overexposure created a high dynamic range imaging, completely preserving the image's details of high brightness and shadows, following which the pin's profile was obtained. Then, they used the pyramid pattern matching algorithm to extract the top feature of the pin from the image. A standard connector was adopted as the reference.