# Compute rotation matrix from EXIF XMP roll/pitch/yaw tags

#1

Hello,

I am trying to compute a East-North-Up (ENU) rotation matrix from the XMP roll/pitch/yaw tags of a saved image. I am currently computing R = Rz(yaw) * Ry(pitch) * Rx(roll) as defined in the PATB convention (that Pix4D supposedly uses).

However, the values do not seem quite right. Would you please help me understand how to generate a ENU rotation matrix from the metadata?

Thank you very much,
Andrew

#2

This doesnâ€™t really explain what you are struggling with.

#3

Thanks for the response, @muzammil360. I am trying to ortho-rectify images based on the latitude/longitude/altitude and roll/pitch/yaw metadata provided in the image EXIF. I am trying to compute a 3x3 rotation matrix that rotates from a East/North/Up coordinate system into image coordinates.

The roll/pitch/yaw coordinate convention seems to differ from other drones (like DJI) which I already know how to interpret. It appears that the roll/pitch/yaw convention is very similar to DJI, but pitch=0 is nadir (whereas DJI defines pitch=-90) as nadir.

Once I compute a rotation matrix I will then project the image to a ground plane in world coordinates.

#4

Hi, were you able to figure out a solution? I have a similar problem. I have the same exif/xmp metadata and I am trying to find a transformation matrix from camera coordinates to ecef world coordinates or vice versa. I followed the pix4d recommended paper to first calculate omega phi kappa, and then camera to ecef rotation matrix. I am not sure if the values obtained are correct or not, but assuming they are, the rotation matrix is still orthonormal i.e no scale component, how am I supposed to move forward?
Any help is appreciated. Thanks