[GRASS-dev] [GRASS GIS] #3545: i.superpixels.slic: behaviour of step parameter confusing

GRASS GIS trac at osgeo.org
Wed Apr 18 04:31:05 PDT 2018


#3545: i.superpixels.slic: behaviour of step parameter confusing
--------------------------+-------------------------------------
  Reporter:  mlennert     |      Owner:  grass-dev@…
      Type:  defect       |     Status:  new
  Priority:  minor        |  Milestone:
 Component:  Addons       |    Version:  unspecified
Resolution:               |   Keywords:  i.superpixels.slic step
       CPU:  Unspecified  |   Platform:  Unspecified
--------------------------+-------------------------------------

Comment (by mmetz):

 Replying to [ticket:3545 mlennert]:
 > The behavior of the step parameter in i.superpixels.slic is a bit
 confusing:
 >
 > [...]
 >
 > Normally, one would expect a larger number of seeds with step=2 than
 step=20. This behavior comes from lines 277ff of main.c, which read:
 >
 >
 > {{{
 > superpixelsize = step * step;
 > if (step < 5) {
 >     superpixelsize = 0.5 + (double)nrows * ncols / n_super_pixels;
 >
 >     step = sqrt((double)superpixelsize) + 0.5;
 > }
 >
 > Why this limit at 5 ? If it is really necessary, it should at least be
 documented in the man page to avoid confusion.
 >
 > }}}
 >
 The reason is that with small step sizes, you would get mini-superpixels,
 mostly squares. The SLIC algorithm likes a somewhat larger distance
 between superpixel centers in order to produce reasonable results. You can
 modify the condition to `step < 2` and see what happens.

-- 
Ticket URL: <https://trac.osgeo.org/grass/ticket/3545#comment:1>
GRASS GIS <https://grass.osgeo.org>



More information about the grass-dev mailing list