next up previous contents index
Next: sr_genhypo Up: Reference Previous: SR_DEMO   Contents   Index

sr_distance

$ \bigcirc$Name


sr_distance Compute distance between two shapes (binary product)




$ \bigcirc$Command Synopsis


sr_distance in1 in2 .



in1 : input shape 1 (Fcurves)

in2 : input shape 2 (Fcurves)

. (screen output) : result




$ \bigcirc$Function Summary


float sr_distance (Shape1 , Shape2 )

Fcurves Shape1 , Shape2 ;




$ \bigcirc$Description


This module computes a simple ``distance'' between two shapes, which can be first normalized using SR_Normalize. This distance is zero when the shapes match up to a translation-rotation, and can be up to 100 when they do not. It is defined by

d (f1, f2) = 100.max($\displaystyle \tilde{{f_1}}$ $\displaystyle \otimes$ f2,$\displaystyle \tilde{{f_2}}$ $\displaystyle \otimes$ f1),

where f $ \mapsto$ $ \tilde{{f}}$ means a dilation of radius 1 (cf. the erosion module). The binary rotation-invariant product f $ \otimes$ g is defined by

f $\displaystyle \otimes$ g = $\displaystyle {\frac{{1}}{{\int\!\!\int \chi_g(M) \, dS(M)}}}$$\displaystyle \inf_{{\theta}}^{}$$\displaystyle \int$$\displaystyle \int$R$\scriptstyle \theta$o$\displaystyle \chi_{f}^{}$(M - Gf) . $\displaystyle \left[\vphantom{ 1 - \chi_g(M-G_g) }\right.$1 - $\displaystyle \chi_{g}^{}$(M - Gg)$\displaystyle \left.\vphantom{ 1 - \chi_g(M-G_g) }\right]$ dS(M),

where $ \chi_{f}^{}$ is the characteristic function of the shape f (i.e such that $ \chi_{f}^{}$(M) = 1 if M$ \epsilon$f, 0 otherwise), Gf is the barycenter of f, and R$\scriptstyle \theta$ is the rotation of angle $ \theta$. These rotations are necessary even when the product is computed between two affine-invariant normalized shapes because the angle normalization is numerically instable.




$ \bigcirc$See Also


erosion, fkcenter, fkplot, fkzrt.




$ \bigcirc$Version 1.3


Last Modification date : Thu Nov 29 20:23:57 2001


$ \bigcirc$Author


Thierry Cohignac, Lionel Moisan






next up previous contents index
Next: sr_genhypo Up: Reference Previous: SR_DEMO   Contents   Index
mw 2004-05-05