Image Restoration Using Automatic Damaged Regions Detection And Machine Learning-Based Inpainting Technique