Abstract:The cutting film machine production line is used for different sizes of film cutting, and the surface of the film of actual production, however, there are various defects, mainly includes the scratches, stains, etc. In view of the traditional manual detection methods inefficient, this article put forward the design of automatic detection based on computer vision, and an improved background difference method for defect detection. Experiments verify the effectiveness of the method and the feasibility of the detection algorithm, realize the rapid detection of film defects and improve the productivity.