This paper describes the training of classifiers entirely based on virtual images, rendered by a ray-tracing software. Two classifiers, a support vector machine and a polynomial classifier, are trained solely with virtual samples and used for classification of real samples. The objects to be distiguished are holes vs. garbage (non-holes) out of a set of hole candidates in images of flanges. We analysed the effect of different classifier parameters and manipulation of the virtual samples.