The invention relates to the field of machine vision and image processing, in particular to a method for attaching a mobile phone cover lens to a liquid crystal display .The method comprises the steps of detecting and positioning the angular point of the cover lens through Canny edge detection and Hough transformation, detecting and positioning the angular point of the liquid crystal display through wavelet algorithm, Sobel edge detection and Hough transformation, calculating the actual three-dimensional coordinates of the cover lens and the liquid crystal display through coordinate system transformation based on the stereoscopic parallax principle, and then adjusting the cover lens and the liquid crystal display according to the three-dimensional coordinate difference value of the two to coincide in the X-Y plane, so that automatic attaching of the cover lens and the liquid crystal display is achieved under visual guidance .By the adoption of the method, automatic attaching of the cover lens and the liquid crystal display is achieved, attaching speed is high, efficiency and precision are high, processes are simple, no personnel limitation is set, manpower resource is saved a lot, cost is low, and adaptability is high.