With the rapid development of image processing and pattern recognition technology, the level of intelligence and automation in industrial production is gradually deepening. Although the field of production automation is already quite extensive, manual inspection is still required for defect detection of products, such as surface scratches, spots, pits, and other appearance features. This inspection method not only increases inspection costs but also involves issues caused by human subjective factors, such as misjudgment, missed detection, low inspection accuracy, and lack of standardization. This project studied theoretical algorithms applied to LCD screen defect detection, including camera calibration and image correction, pattern matching, and considered two types of distortion to simplify the template to improve image distortion, comprehensively developing and implementing technology for an LCD screen defect detection system.