Fixed perfomance time metring and crash with SolvePnP.

Signed-off-by: Nikolaj <ljaljushkin.nikolaj@gmail.com>