karo_shape_moments
No arguments
Description:
selected image considered as binary or skalar pattern with pixle values0 outside the pattern or region and either 1 (for binary) or !=0 for skalar pattern. Calculation of shape moments and other features returned in status. With mean==1 input was binary otherwise skalar! Moments m00=sum, m10,m01 centroid, orientation=theta, mean, h1-h7 Hu's moment invariants, with length.
Result in status:
sum centroid_x,y theta eccenticity mean Hu_moments_1-7 main_axis_lengths
0-14 m00 m10 m01 theta excent mean h1 h2 h3 h4 h5 h6 h7 width length
Result in global variable _karo_shape_moments: moments, centered and normalized moments m, my, eta, Hu's moment invariants h1-h7, orientation, eigenvalues, eccentricity and extension:
0-15 [[$m00,$m01,$my02,$my03],[$m10,$my11,$my12,0],[$my20,$my21,0,0],[$my30,0,0,0]],
16-31 [[$eta00,$eta01,$eta02,$eta03],[$eta10,$eta11,$eta12,0],[$eta20,$eta21,0,0],[$eta30,0,0,0]],
32-39 [$h1,$h2,$h3,$h4,$h5,$h6,$h7,0],
40-47 [$theta,$lambda1,$lambda2,$excent,0,0,0,0]
Examples of use:
• Example #1
$ gmic osteo_ k. +karo_shape_moments _sm=${} to_rgb n 0,255 circle ${arg\ 2,$_sm},${arg\ 3,$_sm},1%,1,255,0,0

Command: osteo_ k. +karo_shape_moments _sm=${} to_rgb n 0,255 circle ${arg\ 2,$_sm},${arg\ 3,$_sm},1%,1,255,0,0
• Example #2
$ gmic osteo_ * +karo_shape_moments _sm=${} to_rgb n 0,255 circle ${arg\ 2,$_sm},${arg\ 3,$_sm},1%,1,255,0,0

Command: osteo_ * +karo_shape_moments _sm=${} to_rgb n 0,255 circle ${arg\ 2,$_sm},${arg\ 3,$_sm},1%,1,255,0,0