bb_avg_edge_length_68_euclidean_error

menpofit.error.bb_avg_edge_length_68_euclidean_error(shape, gt_shape)[source]

Computes the Euclidean error based on 68 points normalised by the average edge length of the 68-point ground truth shape’s bounding box, i.e.

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

where

\[\mathcal{F}(s,s^*) = \frac{1}{68}\sum_{i=1}^{68}\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. Finally, \(\mathcal{N}(s^*)\) is a normalising function that returns the average edge length of the bounding box of the 68-point ground truth shape (bb_avg_edge_length).

Parameters
  • shape (menpo.shape.PointCloud) – The input shape (e.g. the final shape of a fitting procedure). It must have 68 points.

  • gt_shape (menpo.shape.PointCloud) – The ground truth shape. It must have 68 points.

Returns

normalised_error (float) – The computed Euclidean normalised error.

Raises
  • ValueError – Final shape must have 68 points

  • ValueError – Ground truth shape must have 68 points