Simplest Color Balance with OpenCV [w/code]

Color balanceI came across an extremely simple color balancing algorithm here. And I thought I'll quickly transcode it to OpenCV.
Here's the gist:

And an example (photo taken, under CC-Attrib license, from here, Copyright Prayitno photography):

Simplest color balance at 1%
Simplest color balance at 1%
Share