Convert mm to pixels(focal length and principal point)

Hi,
I have one question about Metadata.
When outputting Metadata(XMP file) in RealityCapture, I think that the camera’s internal parameters can be output, but I would like to convert the focal length and principal point units from [mm] to [pixel]. (For example, focal length = 24[mm] → focal length = xx[pixel])
In this case, how should I convert it?

By the way, the information of the captured image is as follows:
Camera: iPhone 15 Pro Max
Resolution: 5712×4284 (height×width)

I would be grateful if you could give me some advice.

Hi @Myyuuuki,
for that you just need to know the pixel size and then just compute the value in pixels.
If you want to get these values straight, you can create your own report where this computation will be included: RealityCapture Help

1 Like

Thank you for your reply!
I don’t know there are “Report Template”.
I looked at this, but is it the same whether I calculate it directly in the report template or calculate it later using the pixel size?

It should be the same then. It depends how you will define it in the reports. But if you don’t need the report export, then you can compute it just manually.

1 Like

Thank you for your help.
But I have another question.
In the RealityCapture, why is the focal length(35mm) used?
Why is the focal length measured in [mm]?

I understood that the advantage of RealityCapture is that intrinsic parameters can be estimated automatically.
But I think that camera pose estimation(SfM or Camera Calibration)is not possible unless the unit of the intrinsic parameters is pixels and RealityCapture knows the mm to pixel conversion formula (I’m still studying SfM, so I’m sorry if I’m wrong).
Given the above, I suspect that RealityCapture has a database about pixel sizes and image sensor size, etc.

Sorry for asking so many questions when you are busy.

I suppose it is an internal decision and it is used in the XMP computation process.
But basically, pixels are not scaled, if you have just that information. Using the units, you are getting another point of view. Also, the focal lengths of cameras are mostly provided in mm.
Maybe this will be helpful for you: https://dev.epicgames.com/community/learning/knowledge-base/vzwB/capturing-reality-realitycapture-xmp-camera-math

Thank you.
I saw this page.
I understand that if I perform alignment without camera calibration, the focal length is calculated at 36 full size in RealityCapture.
So if 36 is not appropriate, should I need to set parameters calculated in advance outside of RealityCapture?
image

If you perform the alignment without camera calibration, the own calibration is provided.
RealityCapture will use the value for internal purposes anyway. But if you know the camera calibration parameters, you can use the priors as fixed.