## 1 Introduction  
The topic of machine vision technology replacing manual examination has recently emerged. This system utilizes digital sensors in an industrial camera to collect images, processes the images via computer software, and then makes decisions after analyzing and measuring various features. Such systems are composed of a console computer, an image capture card, image processors, video camera lighting sources, and a visual display terminal. Machine vision systems used for industrial examination also include a PC-based controller, a programmable logic controller (PLC), and institutional and controlling systems such as a servo motor. Software technology includes algorithms for image processing, artificial intelligence, and pattern recognition [1, 2, 3, 4]. In this respect, [PERSON] et al. in [1] proposed a steel surface defect inspection network with advanced object detection approaches. In their model, a deformable convolution enhanced backbone network is designed to extract the complex features of multi-shape defects. [PERSON] et al. [2] proposed an automated vision-based inspection system to detect the pixel defects on LCD panels. [PERSON] et al. [3] proposed a fully automated vision system to inspect the whole surface of crankshafts, based on the magnetic particle testing technique. They also designed visual inspection system consisting of a stepper motor and multiple cameras to ensure the inspection of the whole surface of the crankshaft in real-time. [PERSON] et al. [4] presented a deep learning algorithm based on the you-only-look-once (YOLO) approach for the quality inspection of printed circuit boards. With the development of optical videography technology and image processing/recognition technology, machine vision technology can not only be applied to facial recognition on computers or mobile devices, but can also widely replace manual quality examinations in industrial automation. For example, Automatic Optical Inspection (AOI) technology has been adopted for the detection of defects in semi-finished/finished products and is widely used for the defect detection of PCB in the electronic industries where SMT is applied [5; 6; 7; 8; 9; 10]. [PERSON] et al. [5] proposed an effective self-adaption method that collects \"exception data\" such as the samples with which the Artificial Intelligent (AI) model made mistakes from the automated optical inspection inference edge to the training server, retraining with exceptions on the server and deploying back to the edge. The proposed defect detection system has been verified with real tests that achieved a detection rate of 99.99% with a FAR 20-30% and less than 15 of inspection time on a resolution 7296 \(\times\) 6000 PCB image. In order to inspect solder joint defects of Integrated Circuit (IC) components on Printed Circuit Boards (PCBs), [PERSON] and [PERSON] [6] developed an AOI algorithm. They divided solder joint into several subregions as shape features, and its digital features were extracted by the area, mass center, and continuous pixels. To address the problem of the fixed templates, [PERSON] et al. [7] proposed an IC solder joint inspection method by making an attempt to utilize different templates for different IC solder joints. To this aim, they first used a number of qualified solder joint images to construct a dictionary. Then, they formulated the construction of the adaptive template for each IC solder joint as an optimization problem, which is solved by the elastic net. The defects can be inspected by the difference image between the IC solder joint image and its corresponding adaptive template. [PERSON] and [PERSON] [8] proposed a global fourier image reconstruction method to detect and localize small defects in nonperiodical pattern images. This method is based on the comparison of the whole fourier spectra between the template and the inspection image. The inverse Fourier transform is then applied to reconstruct the test image, where the local anomaly will be restored and the common pattern will be removed as a uniform surface.