Added extractCentroids