fixed compatibility issues with other opencv version