The earlier recipes taught you how to encapsulate an algorithm into a class. This way, the algorithm becomes easier to use through a simplified interface. Encapsulation also permits you to modify an algorithm's implementation without impacting the classes that use it. This principle is illustrated in this recipe, where we will modify the ColorDetector class algorithm in order to use another color space. Therefore, this recipe will also present an opportunity to introduce color conversions with OpenCV.
Converting color representations
Getting ready
The RGB color space is based on the use of the red, green, and blue additive primary colors. These have been selected because when they are combined together, they can produce...