grass icon indicating copy to clipboard operation
grass copied to clipboard

[Feat] i.segment: Expose the radiometric and shape weights to the user

Open pierreroudier opened this issue 1 year ago • 0 comments

In the current documentation of i.segment, it reads that:

Both Euclidean and Manhattan distances use the normal definition, considering each raster in the image group as a dimension. In future, the distance calculation will also take into account the shape characteristics of the segments. The normal distances are then multiplied by the input radiometric weight. Next an additional contribution is added: (1-radioweight) * {smoothness * smoothness weight + compactness * (1-smoothness weight)}, where compactness = Perimeter Length / sqrt( Area ) and smoothness = Perimeter Length / Bounding Box.

My understanding is that in its current state, radio_weight = 1, and therefore smoothness_weight is ignored.

I do see in the code, though, that those parameters seem to be possible to set, and that a function to calculate the shape index exists. Sorry, @metzm, unfortunately I do not know C enough to investigate much further than this!

Is there a way to expose and use the two parameters radio_weight and smooth_weight? At the moment it seems to be a significant limitation of i.segment, in particular in situations where strong linear features exists, it makes it hard to prevent i.segment to create "spaghetti" long, thin, elongated regions.

pierreroudier avatar Feb 01 '24 01:02 pierreroudier