An Image Preprocessing Scheme Based on Machine Learning for ROI Extraction