[GRASS-dev] i.superpixels.slic ( was: #3142 Implementing SLIC image segmentation)

Moritz Lennert mlennert at club.worldonline.be
Sun Dec 18 05:53:05 PST 2016


On 18/12/16 14:01, Rashad Kanavath wrote:
> Hello,
>
> As promised, I had pushed code to G7 addons repo
>
> https://trac.osgeo.org/grass/browser/grass-addons/grass7/imagery/i.superpixels.slic
> <https://trac.osgeo.org/grass/browser/grass-addons/grass7/imagery/i.superpixels.slic>

Great job, thanks a lot !

>
> I had tested with some small datasets and is working.
>
> More testing welcome :)

I get the following warning during installation:

main.c: In function ‘main’:
main.c:514:13: warning: implicit declaration of function ‘min’ 
[-Wimplicit-function-declaration]
      seedx = min(g_width-1,seedx);
              ^~~

I think you have to explicitely define min() through a macro, or AFAIK 
you can use fmin() as elsewhere in the code.

Also:

- The output as it is now is not very useful. What we would need is a 
map with each pixel containing the label of the superpixel it belongs 
to. In the original code, there are both outputs: i) an image of the 
superpixel limits overlayed over the original image, ii) the labeled pixels

- Linked to the above: currently the superpixel boundaries are two 
pixels wide. A one-pixel boundary would be enough.

- I don't know the details of the algorithm well enough, but would it be 
possible to extend it beyond the use of r,g,b maps as input. Ideally, 
the use should be able to provide a group as input and all maps in the 
group are used in the definition of the superpixels. This should also 
include the case when you only have one band (e.g. black and white 
orthophoto).


Again, many thanks for taking this first step, allowing us to test !

Moritz


More information about the grass-dev mailing list