Reading xmp calibration file and convert to pixel values
Hi,
With reference to the following `xmp` file:
```
<x:xmpmeta xmlns:x="adobe:ns:meta/">
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description xcr:Version="3" xcr:PosePrior="initial" xcr:Position="27.7070404192033 33.579963337408 48.715164610703"
xcr:Coordinates="absolute" xcr:DistortionModel="brown3" xcr:FocalLength35mm="86.2680154860749"
xcr:Skew="0" xcr:AspectRatio="1" xcr:PrincipalPointU="-0.00400263430035788"
xcr:PrincipalPointV="0.000493736760003896" xcr:CalibrationPrior="initial"
xcr:CalibrationGroup="-1" xcr:DistortionGroup="-1" xcr:InTexturing="1"
xcr:InMeshing="1" xmlns:xcr="http://www.capturingreality.com/ns/xcr/1.1#">
<xcr:Rotation>-0.197834370793397 -0.239860969004416 0.950435835436061 -0.78346439520111 0.62140519124989 -0.00625537687490457 -0.589105341331192 -0.745870165535497 -0.31085783403207</xcr:Rotation>
<xcr:DistortionCoeficients>0.40870841087744 -2.41000083001529 -13.896168097102 0 0 0</xcr:DistortionCoeficients>
</rdf:Description>
</rdf:RDF>
</x:xmpmeta>
```
I have two questions:
1. I'm not particularly familiar with such format but it seems to me an `xml` file essentially, so the question is can any `xml` parser parse such file? I need to read these files in a C++ program, and I was looking for an `xml` parser, can you suggest one or will any do the trick?
2. After reading the file I need to convert principal points/ focal length in pixels, at the moment they seem to be expressed in focalLength35 mm, which I wasn't even sure it was. After looking this up I think I can find the focal length in pixels by the formal below, assuming `f35` is the focal length 35 mm, "Y" is the vertical resolution in pixel of the image and `f` is the unknown focal length in pixel it should just be:
f = X*(f35)/24
Is this formula correct? If not which one is it?
-
Hello dear user,
sorry for reaching out to you so late.
please contact support@capturingreality.com with this request and we will try to give you some detailed information regarding this.
Please sign in to leave a comment.
Comments
1 comment