On Daniel Shiffman’s GitHub again I found an example for colour tracking. The code compares the colours of pixels to find the closest match to the one the user tells it to track and draws an ellipse on it to show where it is.
Heres an example of the colour tracking, I made it track the green from a highlighter. Theres a few issues with this tracking as it tracks an exact colour value and sometimes due to differences in lighting and such it can’t see the colour anymore and stops tracking. It also jumps around a lot as it tries to find the best match for the colours its looking for. To get it to track well the colour needs to be very different to everything else in the picture or else it has trouble following it and jumps around a lot.
Again I experimented where I could go using colour tracking using the coordinates it gives for other things. While looking for inspiration, I stumbled across another of Schiffman’s examples, this time from his book The Nature of Code. The example I found had an array of agents which autonomously followed the mouse around the screen. They also have the behaviour to avoid each other so that each agent doesn’t end up on top of each other and makes the movement look more natural.
I combined the colour tracking example and this flock example so that the flock of agents follows a colour around the screen. For this I used my trusty green highlighter again as it stands out against the other colours in my room and wont confuse the tracking.
My next idea was to see how well it could track skin tones, as then it could be used to follow people. It does a quite good job finding the colour, but it jumps a lot between areas of skin such as face, arms and hands which separates the flock and doesn’t really track very well. It also wouldn’t do too well if there were a lot of people as there would be too many possible colours to follow. For my example I made it follow my skin tone which was all fine and well, but if there was someone else with a different skin colour it wouldn’t be able to follow them and that seems pretty racist.
In the space I don’t think the colour tracking will work very well due to the busy space and its limited tracking abilities, however the flock which follows something could be a good starting point for development, looking into the realms of augmented reality and such which could be an interesting route to follow.