Fixes for new version of the OpenCV

Some changes for current OpenCV (3.0, 2X)