mean_pupil_49_error¶

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

Computes the euclidean error based on 49 points normalised with the distance between the mean eye points (pupils), i.e.

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

where

$\mathcal{F}(s,s^*) = \frac{1}{49}\sum_{i=1}^{49}\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 the distance between the mean eye points (pupils).

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

• gt_shape (menpo.shape.PointCloud) – The ground truth shape. It must have either 68 or 66 or 51 or 49 points.

Returns

normalised_error (float) – The computed normalised Euclidean error.

Raises
• ValueError – Final shape must have 68 or 66 or 51 or 49 points

• ValueError – Ground truth shape must have 68 or 66 or 51 or 49 points