Convert center of bottom edge face of camera 3d bbox to the ego-vehicle frame

Hello.

I am trying to convert bottom centers of camera frame 3d-bounding boxes to ego-vehicle frame. Steps I perform are the following:

  1. Get center of the box in camera coordinate frame
  2. Rotate center using sensor2ego_rotation quaternion and the translate it by sensor2ego_translation vector:
    rotation_matrix = pyquaternion.Quaternion(sensor2ego_rotation).rotation_matrix
    center = np.dot(rotation_matrix, center)
    center += np.array(sensor2ego_translation)
  3. Take into account box height (size along z axis in ego vehicle frame):
    center -= height / 2
    Although these steps seem clear and right, resulting z coordinate of the bottom face center never exactly equals zero (as I suppose it should be) and spread around zero with standard deviation about 0.4 m.

I’d like to ask whether is it ok to get such results or am I doing something wrong with my calculations? Thanks in advance.