Background Removal and ROI Segmentation Algorithms for Chest X-ray Images