First revision with OpenCV.
Fixing warnings and improving customizations.