fix opencv formula