Foundry is an important industry that supplies key castings to other industries where they are critical. Hence, foundry castings are subject to very strict safety controls to assure the quality of the manufactured castings. One of the type of flaws that may appear in the castings are defects on the surface; in particular, our work focuses in inclusions, cold laps and misruns. We propose a new approach that detects imperfections on the surface using a segmentation method that marks the regions of the casting that may be affected by some of these defects and, then, applies machine-learning techniques to classify the regions in correct or in the different types of faults. We show that this method obtains high precision rates.