Self-learning visual inspection system for cable crimping machines