What is the reference vector in OpenCV for 3D rotation?

I tried to post this question on StackOverflow, but it seems to cause confusion over there, so I am attempting my luck here again:
I have a multi-camera system where the cameras are mounted to a fixed structure (except for wind-induced vibration, the cameras are not moving). I measured the position and the orientation of the cameras with a total station, which means that I have a rough estimate of the translation vectors and the (what I call) camera’s forward vector (vector pointing from the sensor’s principal point out the front of the camera).

Using the total station, I also measured the 3D position of a couple of markers, and I am now trying to get an extrinsic camera calibration using Calib3D.calibrateCamera().

Sidenote: I did do a separate intrinsic calibration, so we are only talking about the extrinsic parameters tvec and rvec here.

At first, I tried to run calibrateCamera() without any initial values for the extrinsic parameters, but the results were obvious garbage (OpenCV estimated that the cameras must be several km below the ground). I therefore would like to give calibrateCamera() the initial guess that I measured using the total station for tvec and rvec, but I am struggling to convert my forward vector into a Rodrigues vector.

Here’s a figure to illustrate how I understand the situation:

My camera is looking into the direction of v_cam, so, v_cam is the aforementioned “forward vector”. Given some reference vector v_Ref, the Rodrigues vector v_Rodrigues defines the rotation axis around which v_Ref is rotated and through its length, v_Rodrigues defines by what angle v_Ref needs to be rotated to result in v_cam.

So, given that I (roughly) know v_cam, I would like to construct v_Rodrigues by calculating the cross-product of v_cam and v_Ref and scaling the result by the angle between v_Ref and v_cam.

Now, the two questions that I have are:

  1. Is my understanding of the math correct?
  2. How does OpenCV define v_Ref?

The second question could also be rephrased as: “If the rotation were to be represented by a rotation matrix, what direction would the camera be pointing in if the rotation matrix is an identity matrix?”

Cheers, and thank you for your help :slight_smile:

Thanks to the comments on StackOverflow, I did end up finding a solution that seems correct, but I cannot yet entirely explain why :see_no_evil: So, feel free to read what I found and if you have any idea why things are the way they are, please leave a comment on StackOverflow or here in the forum as I would love to get a full understanding of this.