Fixed for more recent versions of openCV.