# how to deal the outpout of barycenter command ?

#1

Hi,
I try to understand the barycenter command. The GMIC’s technical reference give the following example :
256,256 ellipse 50%,50%,20%,20%,0,1,1 deform 20 +barycenter +ellipse[-2] {@0,1},5,5,0,10

I see that {@0,1} gives the coordinates of the barycenter, ok, so far so good !

But I’m unable to understand why, I’ve read the doc but I can’t find anything about the {@0,1} syntax or more generally how to deal the output of the barycenter command.

For example the ouput of gmic 256,256 ellipse 50%,50%,20%,20%,0,1,1 deform 20 +barycenter is (partial output) :
[1] = ‘[barycenter of ‘[unnamed]’~]’:
size = (1,3,1,1) [12 b of floats].
data = (127.528;133.519;0).
min = 0, max = 133.519, mean = 87.0156, std = 75.4172, coords_min = (0,2,0,0), coords_max = (0,1,0,0).

How can I manipulate this data ?

Vince

(Karsten R) #2

In the gmic references pdf page 14 the substitution rules are described:

{@0,1} which is the same as {-1,@0,1} and is replaced by the first and second value of the last image in the list (-1)

(image, feature}
-1,
@subset

barycenter returns the coordinates as an image with three values (kx, ky, kz}) !

#3

Great ! I got it !

so @0,1 is the ’@subset’: The sequence of image values corresponding to the specified subset, and
separated by commas ’,’

Thanx a lot KaRo