dc.description.abstract | The main purpose of this thesis is to use computer vision to automatically detect the shell defects on the pregnancy test kit, and use SCARA robot to pick up and exclude the defective products of them on the moving conveyor belt for realizing the filtering function. In this study, the shell of the pregnancy test kit is transported by a small conveyor belt, to simulate a real factory assembly line. The conveyor belt is designed as two sections: the front section is higher and the rear section is lower. Then when the shell of the pregnancy test kit is transported from high section and drops to the low section, at the same time, it will turn over from one side to the reverse side because of a baffle made by 3D printer at the junction of two sections. Two industrial cameras take the photo of the shell at the high and low sections respectively. Therefore, four kinds of defects need to be detected, which are black spots and lines, oil stains, cutting residual materials, and lack of materials. In order to remove the background outside the shell, the image is pre-processed with binarization and connected-component labeling. It is noted that different defects are analyzed and detected by different algorithms, respectively. For instance, the oil stain and the background can be separated in HSV color space. Black spots and lines are detected by the Neighboring Difference Filter, which can effectively detect defects on blurred surfaces. The cutting residual on the edge is detected by the Douglas-Puck contour algorithm. In the case of the lack of materials, the proportion of the area of the pregnancy test kit is firstly analyzed to determine whether the body is short of material, and then analyzed whether the color of the pin in the HSV color space is broken. If defects are detected on any surfaces, the image taken by the industrial camera on the low section of the conveyor belt will be applied to calculate its moving speed and position coordinate X and Y at the current time. After then, the SCARA robot arm is commanded to pick the shell up if any defect is found. Finally, there are some experiments to show the proposed algorithms are effective for the defects detection of shells and the accurate operations of the SCARA robot. | en_US |