Automatic Color Balancing - Prasanna Venkatesan 1/15/2019
Outline Motivation Problem Statement Algorithms Attempted Solution Lessons Learnt 1/15/2019
Motivation Mosaicing images using cameras arranged to give omni direction view results in color mismatch. Each camera is capturing a different scene 1/15/2019
1/15/2019
Problem Statement To extract the parameters used by the FireWire Camera (it uses 2 channels) for color balancing an acquired image. 1/15/2019
1/15/2019
Problem in extracting these parameters Fire Wire APIs – Provide for setting and recovering the color channel parameters. APIs for recovering color balancing parameters are non-existent. 1/15/2019
Algorithms Attempted To use an algorithm which would give similar results to that used by the cameras algorithm. Algorithms attempted Gray world, White patch hybrid of gray world and white patch assumption Polynomial Mapping 1/15/2019
Description of Gray world Algorithm Assumes average color of image – predefined value of grey. Rn = Ro * mean(Intensity)/ mean(Ro) Gn = Go * mean(Intensity)/ mean(Go) Bn = Bo *mean(Intensity)/ mean(Bo) 1/15/2019
1/15/2019
Results Dependant - average Intensity and means of respective channels in non color balanced image For high intensity pixels, for lower intensity pixels algorithm over corrects. 1/15/2019
Description of White Patch Assumes that maximum value of each channel – corresponds to 255 Rn=Ro*255/max(Ro) Gn=Go*255/max(Go) Bn=Bo*255/max(Bo) 1/15/2019
1/15/2019
Results Very poor color correction. Used along with gray world, much better color correction. 1/15/2019
Description of Polynomial mapping method Polynomial Coefficients Non color balanced image Cameras Color balanced image Coefficients a1=Mean ( Pixels(Meancb +/- sdcb)) / Mean(Pixels(Meanncb +/- sdncb)) a2=Mean( Pixels(Meancb+/- 2*sdcb)) / Mean(Pixels(Meanncb +/- 2*sdncb)) a3=Mean ( Pixels(Meancb +/- 3*sdcb)) / Mean(Pixels(Meanncb+/- 3*sdncb)) 1/15/2019
Results In case of a good distribution of colors -resultant image similar to cameras color balanced image 1/15/2019
1/15/2019
Results (contd.) If the distribution of colors is less, then resultant image Has out of gamut pixels Not similar to that of color balanced image 1/15/2019
1/15/2019
The solution Properties of Color Balanced Image (cameras Algorithm) Means of the channels (corresponding to color space) converge -similar value. value dependant on illuminant of the scene. 1/15/2019
Mean(red)-0.9569 Mean(green)-0.5807 Mean(blue)-1.4180 Color Imbalanced Image 1/15/2019
Mean (red)-0.5888 Mean (green)-0.5719 Mean (blue)-0.5965 Color balanced Image 1/15/2019
Reverse Engineering to Obtain Parameters Using Fire Wire APIs Set parameters for the color channels Scan through range of all the possible parameters. Find the 2 mean channel ratios redavg/greenavg, blueavg/greenavg for each set value. Find the combinations of the parameters which make the 2 mean ratios to lie within the threshold of 0.9 & 1.1. Choose those values whose mean ratios are nearest to one. Retrieve these values, as the camera balancing parameters 1/15/2019
Demo 1/15/2019
Lessons Learnt In any project – what ever be its nature. Spend enough time in the problem space, understanding the problem. Understanding why it is a problem. Clients way of viewing the problem- need not be right. For instance, U/B & V/R was mistaken to be U over B & V over R rather than U or B and V or R Y = 0.299*R+0.587*G+0.114*B U/B = 0.492*(1-Y/B) = 0.3780-0.1471*(R/B) -0.2888*(G/B) V/R = 0.877*(1-Y/R) = 0.6148-0.5148*(G/R) -0.1006*(B/R) 1/15/2019
References Fast color correction using principal regions mapping in different color spaces Maojun Zhang*, Nicolas D. Georganas Distributed and Collaborative Virtual Environments Research Laboratory (DISCOVER), University of Ottawa, Ottawa, Canada www.poynton.com http://www.vision.ee.ethz.ch/~buc/brechbuehler/mirror/color/Poynton-color.html A new algorithm for unsupervised global and local color correction Alessandro Rizzi, Carlo Gatta, Daniele Marini July 2003 Pattern Recognition Letters, Volume 24 Issue 11 Comparison of the accuracy of different white balancing options as quantified by their color constancy J A Stephen Viggiano, jasv@acolyte-color.comAcolyte Color Research,West Henrietta, NY, USA A Comparison of Algorithms for Mapping Color Between Media of Differing Luminance Ranges ,J. A. Stephen Viggiano and C. Jeffrey Wang,Imaging Division RIT Research Corporation 1/15/2019