Automated optical inspection machine (AOI) is a new type of testing technology. It has developed very rapidly in recent years. The structure of AOI consists of four parts: workbench, CCD camera system, electromechanical control and system software. When testing, firstly, the circuit board to be tested is placed on the workbench of the AOI machine, and the detection procedure of the product to be detected is called out through positioning. The X/Y workbench will send the circuit board under the lens according to the command of the setting program. With the help of the special light source, the lens will capture the image required by the AOI system and analyze it, then the processor will move the lens toward the lens. The next position is collected for the next image and then analyzed, and the image is subjected to continuous analysis and processing to obtain a higher detection speed.