# euclidean_bb_normalised_error¶

menpofit.error.euclidean_bb_normalised_error(shape, gt_shape, norm_shape=None, norm_type='avg_edge_length')[source]

Computes the Euclidean error between two shapes normalised by a measure based on the ground truth shape’s bounding box, i.e.

$\frac{\mathcal{F}(s,s^*)}{\mathcal{N}(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^*)$$ is a normalising function that returns a measure based on the ground truth shape’s bounding box.

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.

• norm_shape (menpo.shape.PointCloud or None, optional) – The shape to be used to compute the normaliser. If None, then the ground truth shape is used.

• norm_type ({'area', 'perimeter', 'avg_edge_length', 'diagonal'}, optional) –

The type of the normaliser. Possible options are:

Method

Description

bb_area

Area of norm_shape’s bounding box

bb_perimeter

Perimeter of norm_shape’s bounding box

bb_avg_edge_length

Average edge length of norm_shape’s bbox

bb_diagonal

Diagonal of norm_shape’s bounding box

Returns

error (float) – The computed Euclidean normalised error.