OpenCV.js adaptiveThreshold
ADAPTIVE_THRESH_GAUSSIAN_C
ADAPTIVE_THRESH_MEAN_C
flip
src on GitHub