Way to verify or validate R and t given by solvePnP

Hello Filip.
I found few examples generating random 3d points used for projectPoints().
The projectpoints() gives a set of 2d points. How can we calculate errors between these points and those used in pose estimation.