Surface roughness is one of the key characteristics of machined components as it affects the surface quality and, consequently, the lifetime of the components themselves. The most common method of measuring the surface roughness is contact profilometry. Although this method is still widely applied, it has several drawbacks, such as limited measurement speed, sensitivity to vibrations, and requirement for precise positioning of the measured samples. In this paper, machine vision, machine learning and evolutionary optimization algorithms are used to induce a model for predicting the surface roughness of automotive components. Based on the attributes extracted by a machine vision algorithm, a machine learning algorithm generates the roughness predictive model. In addition, an evolutionary algorithm is used to tune the machine vision and machine learning algorithm parameters in order to find the most accurate predictive model. The developed methodology is comparable to the existing contact measurement method with respect to accuracy, but advantageous in that it is capable of predicting the surface roughness online and in real time.