I’m starting my studies on satellite image segmentation at OTB. I did a search before here on the forum to see if there are some things that could help me, some clarified me, but I still have doubts to “draw” it in my mind.

After a lot of research, one of the most complicated parameters to understand is the “range radius”, besides I see that it is very important.
my ref:

I understood that it “is the Euclidean distance that measures the difference, in spectral terms, acceptable to include a pixel in a certain segment (group)” (check if that’s right).

My doubt is: Does this spectral difference refer to the whole image or to a set of target objects?

Considering a multispectral image with three bands (size 3x3 pixels), how would I determine the Euclidean distance (range radius) in a single number of these three bands? (I don’t know if I’m on the right path or confused).

MeanShift is a pixel based segmentation.
Here are the steps of the algorithm:

For each pixel

Compute the euclidean distance between the spectral values of the pixel and the spectral values of its neighbors (the size of the neighborhood is set with the spatialr parameter).

Compute the average of all pixels with distance lower than the ranger parameter.

The value of the pixel is set to the computed average.

Iterate until convergence (changes during the iteration are lower that thres) or stop after maxiter iteration.

The documentation of the application is here, it gives some more details on the algorithm.

If I take your 3x3 image example, and I consider the pixel at the center (spatialr=1), I can represent it as a vector like this [51, 91, 191].
I then compute the distance for each neighbor:
[50, 70, 197] → 21.86
[52, 83, 192] → 8.12
[48, 100, 193] → 9.7
[51, 91, 189] → 2
[47, 101, 190] → 10.82
[50, 93, 193] → 3
[52, 89, 189] → 3
[45, 108, 201] → 20.62

Let say ranger is set to 5, then you keep the pixels [51, 91, 189], [50, 93, 193], [52, 89, 189]. The mean is [51, 91, 190,5]. This is the new value of the central pixel.

The range depends on the dynamics of the image and the type of objects that can be found on it. This is why I can’t give you a typical value. I suggest that you try different values, to see what happens.