# euclidean_distance_normalised_error¶

menpofit.error.euclidean_distance_normalised_error(shape, gt_shape, distance_norm_f)[source]

Computes the Euclidean error between two shapes normalised by a distance measure between two shapes, i.e.

$\frac{\mathcal{F}(s,s^*)}{\mathcal{N}(s,s^*)}$

where

$\mathcal{F}(s,s^*) = \frac{1}{N}\sum_{i=1}^N\sqrt{(s_{i,x}-s^*_{i,x})^2 + (s_{i,y}-s^*_{i,y})^2}$

where $$s$$ and $$s^*$$ are the final and ground truth shapes, respectively. $$(s_{i,x}, s_{i,y})$$ are the x and y coordinates of the $$i$$’th point of the final shape, $$(s^*_{i,x}, s^*_{i,y})$$ are the x and y coordinates of the $$i$$’th point of the ground truth shape and $$N$$ is the total number of points. Finally, $$\mathcal{N}(s,s^*)$$ is a normalising function based on a distance metric between the two shapes.

Parameters
• shape (menpo.shape.PointCloud) – The input shape (e.g. the final shape of a fitting procedure).

• gt_shape (menpo.shape.PointCloud) – The ground truth shape.

• distance_norm_f (callable) – The function to be used for computing the normalisation distance metric.

Returns

error (float) – The computed Euclidean normalised error.