Gravar-mail: Adaptive image pre-processing for quality control in production lines