Image processing for Pattern Recognition