Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

currently, all your 5 cluster images reference the same set of pixels, so you get 5 times the same image.

solution: make a new (seperate) Mat for each cluster.

for(int i = 0; i < centers.rows(); i++) {
    Mat light = new Mat(cutout.size(),cutout.type(), new Scalar(255,255,255));
    clusters.add(light);
}