The inspection of defects is an important task in many industrial sectors: from metals to plastics, passing through glass and other materials, these products need to satisfy some aesthetical and quality requirements. Flaws can arise in many different forms: spot of different color, crack, incompleteness, excess and/or lack of material are just some examples of defects deriving from the industrial manufacturing process, which can lead to discard the component or the piece examined. These defects are recognizable by the human eye, but some issues like fatigue, illness of the operator and incorrect lighting of the samples can be tough obstacles in obtaining the right selection of the pieces. To detect faulty pieces and in order to avoid wasting compliant pieces instead, a computer based visual inspection system has been designed and implemented. As benchmark samples we adopt the outer lenses of automotive rear lamps. The surface of an outer lens needs an extreme precision manufacturing procedure and the absence of defects is essential for the quality of the final product. The aim of the work involves the ideation and commissioning of a setup to extract and analyze information about the flaws present in an outer lens, exploiting different image processing techniques depending on the nature of the defects.