## 3 Design of a High-Speed Real-Time Defect Detection System Based on Line-Scan Camera  
For the defect inspection of mass-produced semiconductor components or PCBs that move quickly on a conveyor belt, real-time precision inspection and rapid feedback on the inspection results are required. A line-scan camera, which can capture large objects with real-time, high-speed, high-resolution imaging, is ideal as it images an entire object with a single line. As shown in Figure 2, when continuous movement or high-resolution imaging is needed, a line-scan camera significantly outperforms an area-scan camera. Line-scan technology is suitable for applications requiring large, high-resolution, and high-speed image capture, such as continuous web inspection of paper, fabric, metal, and glass tape. It is also used for railway and road inspections, satellite imaging, and surface topography scanning. Line-scan technology is particularly useful for inspection tasks requiring large, defect-free images, such as silicon wafers, FPDs, solar cells, PCBs, and for medical diagnosis. The real-time, high-speed defect detection system based on the line-scan camera proposed in this paper was configured to capture detailed images of the component mounting and soldering conditions on a PCB. The setup includes a line-scan camera frame positioned for side-view imaging, allowing the test object to be rotated and captured from multiple angles. The system consists of a trigger module to indicate the start of image capture, an image preprocessing module, a deep learning-trained AI engine for defect detection, and an integrated operational platform. Figure 3 shows the structure of the real-time line-scan system. Image preprocessing is a crucial step before applying defect detection AI because it significantly enhances processing speed and accuracy. Figure 2: Area-scan camera vs. line-scan camera. The main components include a line-scan camera controller, which manages the operation and settings of the line-scan camera; a line-scan camera positioned to move back and forth for side-view imaging; and a rotating disc for rotating the test object to capture images. The rotation angle of the disc can be set arbitrarily. For example, if it is set to n\({}^{\circ}\), the disc rotates in multiples of n within 360\({}^{\circ}\), triggering the line-scan camera accordingly. This study focuses on the detection of the following seven types of defects:  
**Missing Ball:** When there is no component in the position where it should be placed. **Double Ball:** When soldering occurs twice in the same pattern or on land, producing excess material. **Bridge Ball:** A short circuit defect in the connection area of the circuit, or a short circuit between soldered pads where no component is mounted. **Foreign Material:** When foreign material is inserted into the lead of the component. **Extra Ball:** When the component's electrode or lead is lifted more than 0.5 mm from the land surface, indicating a defect. **Ball Damage:** When the lead of the component is damaged. **Ball Placement:** A defect occurs if the electrode deviates beyond half of the outer line of the land area, or if it deviates beyond half of the line on either side of the land area. Figure 4 shows the software architecture of the line-scan camera-based defect inspection system. When the controller sets the rotation angle and activates the system, the line-scan camera module initiates the operation and triggers the camera. At the first angle, the camera captures an image as it moves. When it reaches the endpoint, the disk rotates to the preset angle, and the line-scan camera captures another image as it returns to the starting point. Images captured during the return period are saved after vertical flipping. Figure 5 shows the prototype of the movable defect inspection device that uses a line-scan camera for side-view imaging. The control system calculates the movement speed of the camera (forward and return speeds) to determine the trigger and capture speeds.