updated opencv formula