This project implements Gain Robust optical flow.
An optimized version of https://github.com/tum-vision/online_photometric_calibration/blob/master/src/GainRobustTracker.h.
OpenCV 3.4+
Eigen
Just clone the repo and build it!
OpenCV must have this modules: core, imgproc.