# Spatial and range radii in MS+LSMS vs Segmentation

**URL:** <https://forum.orfeo-toolbox.org/t/spatial-and-range-radii-in-ms-lsms-vs-segmentation/1088>\
**Category:** OTB Usage\
**Created:** [June 11, 2021, 10:04am UTC](https://forum.orfeo-toolbox.org/t/spatial-and-range-radii-in-ms-lsms-vs-segmentation/1088 "2021-06-11T10:04:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![alobo](https://forum.orfeo-toolbox.org/user_avatar/forum.orfeo-toolbox.org/alobo/32/132_2.png) [@alobo](https://forum.orfeo-toolbox.org/u/alobo)\
**Post date:** [June 11, 2021, 10:04am UTC](https://forum.orfeo-toolbox.org/t/spatial-and-range-radii-in-ms-lsms-vs-segmentation/1088/1 "2021-06-11T10:04:36Z")

</div>

According to [https://www.orfeo-toolbox.org/CookBook/Applications/app\_LSMSSegmentation.html:](https://www.orfeo-toolbox.org/CookBook/Applications/app_LSMSSegmentation.html:)

“A good value is half the spatial radius used in the MeanShiftSmoothing application (spatialr parameter).”  
in both Spatial and Range radii.

Segmentation,  
[Segmentation — Orfeo ToolBox 7.3.0 documentation](https://www.orfeo-toolbox.org/CookBook/Applications/app_Segmentation.html), which combines MS and LSMS, only asks for one pair of radii:  
**Spatial radius** `-filter.meanshift.spatialr int` _Default value: 5_  
Spatial radius of the neighborhood.  
**Range radius** `-filter.meanshift.ranger float` _Default value: 15_  
Range radius defining the radius (expressed in radiometry unit) in the multispectral space.

Should the user understand that the provided values (5 and 15 in the example) are repeated in both steps or is the aforementioned “good value” silently applied in the 2nd step?

---

<div class="post-metadata">

**Author:** ![alobo](https://forum.orfeo-toolbox.org/user_avatar/forum.orfeo-toolbox.org/alobo/32/132_2.png) [@alobo](https://forum.orfeo-toolbox.org/u/alobo)\
**Post date:** [June 13, 2021, 6:02pm UTC](https://forum.orfeo-toolbox.org/t/spatial-and-range-radii-in-ms-lsms-vs-segmentation/1088/2 "2021-06-13T18:02:56Z")

</div>

Answer in [Image processing — Orfeo ToolBox 8.1.2 documentation](https://www.orfeo-toolbox.org/CookBook/recipes/improc.html#segmentation)

> The range and spatial radius used for the segmentation step are half the values used for Mean-Shift smoothing, which are obtained from LargeScaleMeanShift parameters.
