An Automatic Optical Inspection System for the Diagnosis of Printed Circuits Based on Neural Networks