Ask Your Question

Revision history [back]

Superpixel

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 } }

}

click to hide/show revision 2
None

updated 2018-04-17 01:41:47 -0600

berak gravatar image

Superpixel

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 } }

}

}

}