make compatible with open cv 3.0