Automating the polarizing filter

Final project by

Eyal Mehoudar and Eran BenDror

mehoudar@cs.bgu.ac.il
eranben@cs.bgu.ac.il


Introduction

As photography evolves, camera operations and its components are getting more
and more automated: the aperture and shutter speed are determined by the
camera's software, the focus by the digital lens and even the flash bulb knows
what to do all by itself. It is our goal to provide the amateur photographer
another tool: automatic polarizing filter.

What is a polarizing filter?
Light can be described as a wave consisting of two perpendicular components.
A polarizing filter only transfers light in a specific plane (it has an adjustable
inner ring to allow choice of said plane) thus reducing or eliminating glare and reflections.
Reflected light in a scene often has the effect of washing out the colors in an photo,
resulting in low-contrast, grayish colors. A polarizing filter improves both contrast and
color saturation by filtering reflected light; at the same time, such a filter reduces the
effect of glare from shiny surfaces such as water. While image editing software can correct
contrast and color saturation within an image, nothing can be done after the fact about glare
the only answer to this problem is a filter to eliminate the excess light at the time the photo is taken.

Approach and Method

We have tried to contrive an algorithm that will choose from an array of pictures of the same object, taken with different angles of rotation for the polarizing filter the one that the human photographer would have chosen, i.e. saving the effort of deciding and the time taken for that purpose.

In addition, in order for the solution to practical for low cost devices, we require the run time of the algorithm be minimal.

 

The algorithm

Given: a set of B&W digital pictures of a particular object taken with single difference of the polarizing filter rotation (the rest of the parameters, in particular the exposure, are maintained).

Output: there are several output channels for the algorithm:

  1. Recognition of all the area affected by the filter.
  2. For each input picture a score for each recognized affected reflectance indicating the region's average intensity.
  3. For an initial decision parameters, the selected optimal picture.

 


Example images:

 

Maximum Glare

Medium Glare

Minimum Glare


 The stages of the algorithm:

  1. Picture alignment.
  2. Initial guess.
  3. Gaussian smoothing.
  4. Differentiation.
  5. Modified hysteresis.
  6. Scoring.

 

Results

 

3. Gaussian smoothing

 

 

4. Differentiation

 

 

5. Hysteresis

 

6. Scoring

Using 4.tif as MAX entropy, 6.tif as MIN entropy

Analyzing picture (1) 4.tif:

Label 1 intensity is: 96.140

Analyzing picture (2) 5.tif:

Label 1 intensity is: 72.045

Analyzing picture (3) 6.tif:

Label 1 intensity is: 61.293

 

Conclusions

 

Our solution still requires two parameters to be set. These are the lower and upper threshold for the hysteresis. Albeit that these parameters need only be chosen from a relatively small domain, (for the upper bound; values between 110-170 and 30-50 for the lower bound, all from the range of 0-255) still these parameters have to be correctly chosen for meaningful results.

We think that through further research this process could be made automatic. Since the domain is relatively small, and changes in each parameter are linear in the sense that increasing one always reduces the marked output, a trial and error algorithm can quickly converge to a predefined marked percentage.

Moreover for practical use a choice of selection criteria should be formulated. That is if this algorithm is ever implemented in a camera for instance, the interface will probably contain more general desired characteristics, like "Maximum glare", "Minimum glare" etc…

 

Additional Information

 

References:

  1. http://www.geocities.com/cokinfiltersystem/polarizer.htm
  2. http://www.cs.utah.edu/~shirley/papers/spencer95.pdf
  3. http://www.shooter.net/index.php/weblog/Item/using-a-polarizer/
  4. http://www.worldstart.com/tips/tips.php/139
  5. http://www.cs.bgu.ac.il/~ben-shahar/Teaching/Computational-Vision/index.php