Implementing the Max RGB filter in OpenCV