Getting location of an Sfm camera

I’m trying to understand a nuance in the SfmCamera and ISfmCameraModel data structures.

SfmCameras have a translation vector SfmCamera.t , which should be the same thing (or negative) of the camera position relative to the Sfm Coordinate system origin, right?.  However, in the SfmCameraModel interface definition, there is a function called “GetCameraCentre”, which seems to output values to a four element vector.  What’s the difference?

DECLAREINTERFACE( ISfmCameraModel, IUnknown, “{. . . }” )
void GetCameraCentre( __in const SfmCameraTransform &camera, __out_ecount(4) double *C );

If I want to use any of the methods in ISfmCameraModel to get further info from a reconstruction (like projecting 3D points to camera images), I need to get access to the instance inside ISfmReconstruction, (or a copy of it) but I don’t understand how to do this.  Any advice? 

Greetings.

 

The camera model can offset cameras’ centres, thus to obtain correct camera centre, get it from ISfmCameraModel->GetCameraCentre().

 

In computer graphics are commonly used homogeneous coordinates to allow affine transformations. Simply said, a four-vector is used to represent 3d position with the fourth element carrying additional information.

 

In this case You shall normalize the point by dividing all its elements by the fourth element (thus the fourth element would become 1.0), but ISfmCameraModel->GetCameraCentre() shall already return normalized vector. So You can directly use the position and ignore the fourth element (, or to be sure assert in code that it equals to one).