Machine vision method was used to measure the surface roughness for different Φ38 mm grinding axes in different ambient light conditions. To analyse the effect of ambient light, a method based on the grey-level co-occurrence matrix was applied at the first step. Then, a new calculation method was proposed to minimise the effect of ambient light during measurement. At the calibration stage, the intensity of ambient light was put into consideration to indicate the relationship between the surface roughness and the corresponding features of the workpiece image. To measure an unknown workpiece, the corresponding features of ambient light and inspected workpiece would be input to calculate the roughness value. Finally, a case study is provided to demonstrate the measurement procedures and effectiveness of the proposed methodology. The experiments show that the proposed method has better accuracy than the grey-level co-occurrence matrix method when the error between inspecting value and its corresponding real surface roughness is set at 0.05 μm.