Color Detection
Computer Vision / Python / OpenCV / Numpy

The golden rule: ‘If you can build a rule-based system that doesn't require machine learning, do it.’ I created this project based on this principle. Using only the OpenCV library, I designed a colour detection system that is extremely lightweight and can work with high efficiency even on extreme devices.

I have 3 different coloured Lamy fountain pen cartridges, and I took a video by passing them through the tape in a mixed way. The cartridges have caps on the ends of the cartridges, which are the same colour as the ink inside them, and I used these cap colours as a distinguishing feature. I took the average value of each colour and converted it to HSV format. I determined the upper and lower colour values. I included the values of the passing cartridge in the group to which colour it belongs.

The reason for using the HSV colour format in this project is that it is much easier to separate colours than the RGB (or BGR in OpenCV) colour format. The HSV format provides a great advantage in colour detection as it separates hues, saturations and brightnesses more clearly.

As a result, in some scenarios, it is possible to create an effective and efficient colour detection system with a rule-based approach without the need for complex machine learning algorithms. In this way, many problems can be overcome by building low-cost systems.

Other Projects