The image of an object can vary dramatically depending on lighting, specularities/reflections, and shadows. Thus, removing undesired reflections from images is of great importance in computer vision and image processing. It means to enhance the image quality for aesthetic purposes as well as to preprocess images in machine learning and pattern recognition applications. Thus, the goal of the project is to review various techniques that are used for removing reflection from the image.
Python, OpenCV, Pytorch(torch & torchvision), Imutils, Matplotlib, Argparse, NumPy, Skimage, Pandas, SciPy and, MATLAB.
The sample image used for testing is provided by SIR2 benchmark dataset.
- Averaging : For given set of images, we perform averaging for reflection removal.
Open the Averaging
folder and run python Averaging.py -i 5_images_lowers
where -i is path to folder which contains set of images.
- Independent Component Analysis : Based on concept of reflection of light and independence of underlying distribution in reflected image, two images captured at different polarising orientation are taken and solved for: Y=MX , where Y = [y1, y2] , two images , M is mixing matrix [a,b; c,d] (each denoting the amount of reflection) and X= [x1,x2] are painting and reflecting components in the two images.
Open the ICA
folder and run python ICA.py -i1 1.png -i2 2.png
where -i1 and -i2 are path to input images.
Note : For next two techniques, you need MATLAB software.
- Relative Smoothness : It models the input image as a linear combination of transmission and smooth reflection layer, I = T + R, where R is a smooth function.Based on sparsity prior of natural scenes, the objective function is to maximize the probability of joint distribution of T and R.
You can go here and run reflection_removal.m
- Reflection Suppression via Convex Optimization : Convex model is used to suppress the reflection from a single input image. It implies a partial differential equation with gradient thresholding, which is solved efficiently using Discrete Cosine Transform.
You can go here and run reflecSuppress.m
- Reflection Removal using Deep Learning : Single-image reflection removal method based on generative adversarial networks.
First you need to download this and place inside /Deep_Learning
folder.
Now, open the Deep_Learning
folder and run python GANs.py --path /input
where --path path to input dataset that contains reflection images.
- Averaging : We have done averaging by taking 5,10 and 20 number of input images.
Limitations : Averaging requires set of images to remove reflection.
- Independent Component Analysis : It takes two images as input. As in this method, the images is a mixture of some ratio two images and our goal to separate the two images. We have generated the images for testing.
Limitations : The techniques employed here, work under their underlying assumptions, ICA requires two same layers being at different polarisation angles, which is a rare phenomenon.
- Relative Smoothness : Images from SIR2 benchmark dataset are used to remove reflection.
Limitations : Relative smoothness removes reflections which are smooth in nature.
- Reflection Suppression via Convex Optimization :
Limitations : Reflective suppress tries to suppress reflection, as parameter h increases the image tends to more blur.
- Reflection Removal using Deep Learning :
Note : For more details. go through Reflection Removal Techniques : Review