Image Deblurring Application that tests an image for bluriness and deblurs the image
This project aims to be an application that does two major things -- check if an image is a blurry and if so, deblur the image. Hence, there are two steps.
- Blur Detection and Deblur To just run the blur detection and deblurring, use the detect_blur_image file, with the path of the image as an argument
python detect_blur_image.py --image PATH
- Train Network If you wish to train the network and then run the program, do the following.
⋅⋅⋅First get the images that you wish to blur and save it in the folder called 'inputs.' Then add the Gaussian blur to your own set of images using
python ../src/detect_blur_image.py --image PATH
⋅⋅⋅To train the network, run the following. Change the number of epochs according to your requirements
python deblur_train.py --epochs 50
The blur detection here is based on the magnitude of the Fast Fourier Transform as explained in this paper. The code for the same is based on the helpful tutorial shown over here.
Once it is detected that the image is blurry, we then use a slightly modified version of the SRCNN model as described here.
The model is trained using images from this Kaggle blur dataset, for images that have Gaussian blur. The code is based on the tutorial on this website