The invention discloses a lens surface defect detection method and system based on machine vision, a product and a terminal, and relates to the technical field of digital image processing. Two area array light sources are placed at a certain angle, the light sources irradiate the surface of the lens, residual light of the light sources is used for defect detection, so that the defects such as pocks, fingerprints and scratches are highlighted, and the defects are located at the light and shade junction of the light sources; the lens is conveyed on the transmission structure, and when the lens reaches the position below the camera, the camera starts to acquire images and transmits image information to the industrial personal computer in real time, so that rapid online detection of lens defects is realized; and algorithm processing is performed on the acquired image, the characteristics of the defects are highlighted, the defects are classified by utilizing the characteristics of the defects, and finally a detection result is obtained. The mode that the two area array light sources emit light to the two sides is adopted, residual light of the light sources is used for detecting the defects of the lens, the showing force on the defects on the surface of the lens can be enhanced, and a high-quality defect image is obtained.