Very nice. Many years ago I built a machine vision system to inspect Playskool ABC blocks with the same method. I added some erosion to the images of the parts and some dilation to the template images. That way there's a little wiggle room to account for different temperatures of the branding iron and the press that made the embossed letters.
The thing worked pretty well, unfortunately production moved overseas and the company that made the blocks is gone now.
The thing worked pretty well, unfortunately production moved overseas and the company that made the blocks is gone now.