get the code working with opencv3