Neural network trained morphological processing for the detection of defects in woven fabric