In recent years, the glasses had gradually been personal accessory to human life, so the demand of various types of glasses has increased significantly, especially safe glasses and sunglasses. And the requirement of full-inspection of the lens of safe glasses and sunglasses are getting seriously. In the past, the fast lens optical quality inspection where performed by Ronchi test and the Ronchigram images were observed and judged by human eyes. However, the larger uncertainty of measurement will be induced while observing the Ronchi patterns using human eyes. Therefore, this study presents the development of an automatic lens Inspection Instrument based on Ronchi tester, which comprises of the machine vision, image analysis and processing technique without human operation involved. In addition, an optical quality index based on Ronchigram has been developed so as to classify the quality of test lens. In this paper, we propose a lens quality index (LQI) to evaluate the optical quality of lens to be inspected.