ubc-vision/image-matching-benchmark

Eval metric produces wrong result if both t and t_gt are zeros

Opened this issue · 0 comments

I understand that it is an artificial thing, which likely would never happen in practice, but it is good to know anyway.
https://github.com/ubc-vision/image-matching-benchmark/blob/master/utils/eval_helper.py#L99

Code to reproduce:

import numpy as np
t = np.zeros((3,1))
t_gt = np.zeros((3,1))
eps = 1e-15
loss_t = np.maximum(eps, (1.0 - np.sum(t * t_gt)**2))
err_t = np.arccos(np.sqrt(1 - loss_t))
print (err_t)

Out[11]: 1.5707963267948966