Defect detection system for quality assurance using automated visual inspection