# Convert mm to pixels(focal length and principal point)

**URL:** <https://forums.unrealengine.com/t/convert-mm-to-pixels-focal-length-and-principal-point/1882591>\
**Category:** Photogrammetry\
**Tags:** realityscan\
**Created:** [May 31, 2024, 2:56pm UTC](https://forums.unrealengine.com/t/convert-mm-to-pixels-focal-length-and-principal-point/1882591 "2024-05-31T14:56:04Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Myyuuuki](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Myyuuuki](https://forums.unrealengine.com/u/Myyuuuki)\
**Post date:** [May 31, 2024, 2:56pm UTC](https://forums.unrealengine.com/t/convert-mm-to-pixels-focal-length-and-principal-point/1882591/1 "2024-05-31T14:56:04Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![OndrejTrhan](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/ondrejtrhan/32/906565_2.png) [@OndrejTrhan](https://forums.unrealengine.com/u/OndrejTrhan)\
**Post date:** [June 3, 2024, 7:21am UTC](https://forums.unrealengine.com/t/convert-mm-to-pixels-focal-length-and-principal-point/1882591/2 "2024-06-03T07:21:24Z")

</div>

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](https://rchelp.capturingreality.com/en-US/appbasics/reports_functions_and_variables.htm)

---

<div class="post-metadata">

**Author:** ![Myyuuuki](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Myyuuuki](https://forums.unrealengine.com/u/Myyuuuki)\
**Post date:** [June 3, 2024, 9:36am UTC](https://forums.unrealengine.com/t/convert-mm-to-pixels-focal-length-and-principal-point/1882591/3 "2024-06-03T09:36:34Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![OndrejTrhan](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/ondrejtrhan/32/906565_2.png) [@OndrejTrhan](https://forums.unrealengine.com/u/OndrejTrhan)\
**Post date:** [June 3, 2024, 9:47am UTC](https://forums.unrealengine.com/t/convert-mm-to-pixels-focal-length-and-principal-point/1882591/4 "2024-06-03T09:47:10Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Myyuuuki](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Myyuuuki](https://forums.unrealengine.com/u/Myyuuuki)\
**Post date:** [June 3, 2024, 12:57pm UTC](https://forums.unrealengine.com/t/convert-mm-to-pixels-focal-length-and-principal-point/1882591/5 "2024-06-03T12:57:57Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![OndrejTrhan](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/ondrejtrhan/32/906565_2.png) [@OndrejTrhan](https://forums.unrealengine.com/u/OndrejTrhan)\
**Post date:** [June 3, 2024, 1:52pm UTC](https://forums.unrealengine.com/t/convert-mm-to-pixels-focal-length-and-principal-point/1882591/6 "2024-06-03T13:52:37Z")

</div>

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](https://dev.epicgames.com/community/learning/knowledge-base/vzwB/capturing-reality-realitycapture-xmp-camera-math)

---

<div class="post-metadata">

**Author:** ![Myyuuuki](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Myyuuuki](https://forums.unrealengine.com/u/Myyuuuki)\
**Post date:** [June 4, 2024, 3:04am UTC](https://forums.unrealengine.com/t/convert-mm-to-pixels-focal-length-and-principal-point/1882591/7 "2024-06-04T03:04:29Z")

</div>

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](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/d/a/5dac722e10e54c2517460afb94ddae086e96fde0.png)

---

<div class="post-metadata">

**Author:** ![OndrejTrhan](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/ondrejtrhan/32/906565_2.png) [@OndrejTrhan](https://forums.unrealengine.com/u/OndrejTrhan)\
**Post date:** [June 4, 2024, 7:06am UTC](https://forums.unrealengine.com/t/convert-mm-to-pixels-focal-length-and-principal-point/1882591/8 "2024-06-04T07:06:12Z")

</div>

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.
