euclidean_error

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

Computes the Euclidean error between two shapes, i.e.

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

where \((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.

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.

Returns

root_mean_square_error (float) – The Euclidean error.