Reputation: 703
I am trying to figure out how to track different colours (eg. purple/orange) using my webcam. Currently I followed this tutorial:Tracking red colour and have used the code from here: red-object tracking. However, using these I can only track red, green or blue by switching the channels. Can someone guide me on how I can use the code in link 2, but track intermediate colours such as purple, orange, pink etc...
Upvotes: 1
Views: 327
Reputation: 1623
Convert your image to hsv with rgb2hsv. Then threshold based on hue (first) channel. The resulting mask would be used exactly as red channel mask.
Upvotes: 2