Detect object
Okay so I'm writing a code to detect three similar objects with different colours. I'm using python, I can match them with a template to locate them but how do I find their centroids and differentiate them on colour basis?