Implement convert_to_grayscale in opencv engine (fix #274)