[GRASS-user] how to tweak the parameters to speed up i.segment

Moritz Lennert mlennert at club.worldonline.be
Fri Sep 26 04:36:35 PDT 2014

On 26/09/14 11:56, Margherita Di Leo wrote:
> Hi,
> I have not clear understanding how the parameters
> in i.segment could be tweaked to speed up the running time.

> meansize

I suppose you mean minsize ?

This does not speed up running time. It just adds a last iteration that
ignores the threshold parameter and merges segments that are smaller
than minsize to their closest (in variable space) neighbor.

> iterations,

If you set this very low, this can "speed up" the running time, but it
will then merge less segments, even though some might still have
neighbors at a distance less than threshold. So, I wouldn't use it by
default for speeding up the process. I don't think I've actually ever
reached the max iterations...

> memory,

This is probably the parameter you most want to play with. If you have
lots of memory on the machine you can seriously increase this and this
should normally speed up the process.

> In which direction should they be tuned and what are the drawbacks?
> Is there some trick? ;-)

You can try following the suggestion on the man page and go though some 
iteration with increasing threshold parameters, using the output of the 
preceding run as seeds for the next run.

More generally, segmentation is a time-consuming process. i.segment is 
already much faster than the proprietary market leader....

You could possible speed up things if you have several CPUs by cutting 
up your image in several regions and processing them in parallel. Then 
you would probably want to patch the results and run i.segment again 
with this result as seed map. Haven't tried this, yet, though, and so I 
don't know what effect this will have on segmentation results. You might 
have to do some r.mapcalc'ing before patching to ensure that all 
segments have unique ids...


> Thank you in advance
> -- Best regards,
> Dr. Margherita DI LEO Scientific / technical project officer
> European Commission - DG JRC Institute for Environment and
> Sustainability (IES) Via Fermi, 2749 I-21027 Ispra (VA) - Italy - TP
> 261 Tel. +39 0332 78 3600 margherita.di-leo at jrc.ec.europa.eu
> <mailto:margherita.di-leo at jrc.ec.europa.eu>
> Disclaimer: The views expressed are purely those of the writer and
> may not in any circumstance be regarded as stating an official
> position of the European Commission.
> _______________________________________________ grass-user mailing
> list grass-user at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-user

More information about the grass-user mailing list