Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

It looks like you execute kmeans on the whole image. Take a look at: Interactive foreground extraction using grab cut algortihm

Then you can use the result image as mask for src.copyTo(dst, mask); and then execute kmeans. This should work, because copied pixels are those wich are unequal zero in mask image. But I didn't tested it.

It looks like you execute kmeans on the whole image. Take a look at: Interactive foreground extraction using grab cut algortihm

Then you can use the result image as mask for src.copyTo(dst, mask); and then execute kmeans. This should work, because copied pixels are those wich are unequal to zero in mask image. But I didn't tested it.

It looks like you execute kmeans on the whole image. Take a look at: Interactive foreground extraction using grab cut algortihm

Then you can use the result image as mask for src.copyTo(dst, mask); and then execute kmeans. This should work, because copied pixels are those wich are unequal to zero in mask image. But I didn't tested test it.