The bead example mbead.cpp shows you how to train a bead template using a training image, and how to use the trained template to verify a bead for defects in a target image. The example deals with bead paths that follow a polyline and a fixed circle.