Some little fix for opencv 3.0

I've made some little fix for opencv 3.0. We could wrap this for let be still compatibile with 2.4.x series?