Skip to content

Instantly share code, notes, and snippets.

View hobson's full-sized avatar

Hobson Lane hobson

View GitHub Profile
hobson /
Last active April 13, 2018 17:41 — forked from DavidYKay/
Simple color balance algorithm using Python 2.7.8 and OpenCV 2.4.10. Ported from:
""" White balance (color balance)
Adjust colors to flatten color histogram peaks and broaden color spectrum for better color contrast.
This is also sometimes called white balancing or probability distribution whitening.
- Color balance algorithm in [OpenCV](
- Ported to python by [DavidYKay](
- Optimized (`O(N^2)` -> `O(N)`) by @alxrsngartn funded in part by NSF grant number 1722399 to [Aira]( (@jmeyers-aira)
- Incorporated into [nlpia]( by @hobson