fixed for openCV 2.x