Development of a multimaterial and multidefect detection and anomaly prediction system based on machine vision, artificial intelligence and IoT