8

I am attempting to Reduce the glare produced when taking a photo or video of a Reflecting surface; Window, Glasses or another Mobile Device.

I have done some research on the subject, and it seems that some algorithms exist. But I am yet to find a coded implementation.

The reason I need this is because I am making an Application that allows you to read different colours on another devices screen using the camera on your device. And if there is a lot of glare, the colours wont read properly. It needs to be able to distinguish between 16 Colors.

Are there any existing implementations, and if so how would I implement them into Android?

  • What languages do these algorithms exist in? You can write an interface to native c/c++ code via android NDK. – Matt Wolfe Sep 04 '15 at 00:08
  • You almost definitely would need to use NDK for what you are describing anyways, java implementation would likely be way too slow. – Matt Wolfe Sep 04 '15 at 00:09
  • I am not very adept with C++. Ill have a look at it. –  Sep 04 '15 at 00:13
  • After a quick search I found articles about Google and MIT trying to develop an algorithm for this, so I doubt it is trivial. – Zarwan Sep 04 '15 at 00:18
  • I dont want to remove it entirely. Just reduce it so I can read the color on the other phone. Do you have any other suggestions on how I can read it? –  Sep 04 '15 at 00:32
  • 1
    This is hard to do in software. Glare suppression is done with a polarizing filter and while a smartphone with Polaroid sunglasses might look cool it's rather impractical. Here's a video showing how one of the solutions mentioned by @Zar works: https://www.youtube.com/watch?v=xoyNiatRIh4 – aergistal Sep 05 '15 at 23:39
  • This looks very interesting. But yeah looks like this wont work. I have to change my approach. –  Sep 06 '15 at 00:26
  • You could try modifying the image to reduce glare by finding regions (sections of 'n' adjacent pixels) that have pixel values with high brightness and low saturation (potential glare) and then reducing the brightness and increasing saturation of the pixels themselves. It might not work great, but with tweaking and perhaps some edge smoothing you could get an effect that might work. – Alea Kootz Sep 09 '15 at 19:59

1 Answers1

2

I recommend doing a threshold on top of a gaussian blur to identify bright spots in your image and removing them. OpenCV is the industry standard and your best bet for image manipulation. I recommend doing some experiments on a computer first to get your process flow right first, before moving it onto a phone. Also, stay away from anything too novel/complicated.

[1] How to detect Hotspots in an image

[2] http://opencv.org/platforms/android.html

Community
  • 1
  • 1
James
  • 2,742
  • 1
  • 20
  • 43
  • Very Interesting. I have been doing some experimenting. I will let you know how it goes. –  Sep 11 '15 at 05:19