Is there already implementation of the algorithm the removes reflections on windows from photos like described here: http://petapixel.com/2015/05/11/new-algorithm-can-automatically-remove-window-reflections-from-photos/?
This does not require machine learning. It requires however a 2D deconvolution. An image with double reflection
P is nothing else but reflected single image
R convolved with displacement matrix
M superimposed with original intended image
P = R*M + O, where the
* is the 2D convolution symbol.
P is known. However, you can select manually a segment on
P when you see no reflection, in that area,
P-Q==O. Knowing this,
R*M=P-Q == 0 in those areas.
The displacement matrix is unknown. In its ideal state it is a completely black image with only two white pixel at a distance that creates the separation between the double reflection. The task ahead is to extract that matrix from the current image. It is a simple Least Error fitting with some brute force effort on sharpness (acuteness). The result is a matrix with two white spots.
From this, and
R*M== 0 in certain areas, calculate
R, the reflected image.
From this, calculate
O = P-R*M, the image without reflection.
The drawback is that this entire operation can add considerable noise and artifacts.
- Least Error fitting has some residual error (will create edgy artifacts after deconvolution),
- The displacement matrix will not be ideal (introduces blur and noise),
- The deconvolution is not a trivial operation by itself, prone to numerical noise and division by almost-zero problems.
- Area masking in 2D operations will obviously show up in the 2D FFT and when deconvoluting, this will create larger spots (changes in intensity and color).
- Not to mention that if the image is not in super high resolution, quality will degrade quickly.
- And so on...
I suggest using a filter ;-). Or using reflection as an artistic effect. Or avoiding reflection.