porting from Opencv2.9 to 3.0