# Forum

### Author Topic: World 3D coordinate to image coordinate 2D  (Read 6865 times)

#### chaton

• Newbie
• Posts: 1
##### World 3D coordinate to image coordinate 2D
« on: October 31, 2019, 07:16:38 PM »
Hello everyone,

I used agisoft to do 3D reconstruction of random objects. I want to reproject the 3D points I extracted from photoscan (vertex of the 3D mesh of my object whose coordinates looks like -16.37 46.83 372.0356 ... in the camera coordinate system (i.e optical center of the first camera is 0 0 0) I guess) within the images. In order to do so, I also exported the xml calibration file.

I know that lots of people asked for the same question but I don't find any clear answer on how to use the xml file parameters to reproject 3D points in my images.

I am using matlab so it is quite easy for me to extract the parameters from the xml file.

Basically i used the <transform> parameters to generate the external camera parameters matrix E  (i.e Rotation and translation) and I obtain a matrix which looks like:

R      t
0 0 0   1

which seems to be correct.

Then I create the internal camera parameters matrix K:

fx      0       cx
0      fy       cy
0       0         1

Finally I reproject the 3D point Q using the following formula:

q_ = K * M * E * Q
q = [ q_(1)/q_(3)     ;    q_(2)/q_(3)]

with M a transfert matrix defined as

1       0       0      0
0       1       0      0
0       0       1      0

However, the reprojected points seem to be shifted in the image (they are not reprojected onto the object). Am I missing something? Could you please explain me how to use the xml camera file to build a valid reprojection matrix?

Thank you very much for your help