First time here? Check out the FAQ!
answered 2016-03-15 18:14:19 -0600
To find the centroid you probably want to use moments. To differentiate them by color, you can calculate the moments for each of the three channels to get the average color for the shape.