Automatic optical inspection system for the diagnosis of printed circuits based on neural networks