i've this code where im applying the algorithm slic superpixel on a image.
using android studio + opencv contrib .My problem is how can colorise evrey superpixel segments with random colors ' each segment should have a unique colours ' , i tried to manipulate with getlabels , but it will take me too much time ( number of pixel * numberof segments if i use and doble loop ex :
foreach(number_segment) do {
loop all the pixel of the image :
if (pixel not existe in the output) && (pixel in the same segments)
{
pixel = random color ;
add it to the output
}
}
}