Camera Model Equations

We are looking at ingesting reality capture data into our pipeline, we would like to color manage the original camera raw files and distortion (XMP) outside RC.

Would you be open to doing the same? Excuse me if you have done this already I just haven’t been able to find it.

Hi Malcolm
So what exactly do you need? That RC does not undistort images and you can use your own tool for it or ? So you need to know how to get cameras without distortion or ?

Hi Milos,

Yes that’s right.

An external client side vendor is using reality capture to create us a mesh for us.

We are receiving CR2 (camera raws) multiple brackets, fbx, obj, jpg_undistorted and xmp.

Part of our color pipeline will combine the multiple brackets and convert the resulting images into our projects scene referred linear space. We have tools that allow us to bring these and camera locations into our painting applications to help create our final textured model (which is color managed).

The mesh we get from reality capture is just a starting point that is used for a clean topology and uvs. We would like to be able to take the CR2 combine them and convert them into our working colorspace, then use the data in the XMP to undistort these images and recreate the camera positions.

This allows us to have color managed images which are registered with the mesh that comes out of RC.

I’m looking for all RC lens models equations using this XMP data that matches the internal RC un-distortions.

–snip–
<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=“2” xcr:PosePrior=“exact” xcr:ComponentId=“{0A3A540F-744D-4CF7-9BE7-CE4CB00B95EE}”
xcr:DistortionModel=“brown3t2” xcr:FocalLength35mm=“51.5750976017777”
xcr:Skew=“0” xcr:AspectRatio=“1” xcr:PrincipalPointU=“0.0208924261163548”
xcr:PrincipalPointV=“-0.00409728240298516” xcr:CalibrationPrior=“exact”
xcr:CalibrationGroup=“-1” xcr:DistortionGroup=“-1” xcr:InTexturing=“1”
xcr:InColoring=“0” xcr:InMeshing=“1” xmlns:xcr=“http://www.capturingreality.com/ns/xcr/1.1#”>
<xcr:Rotation>0.909764219186627 -0.409528010104603 -0.0679402268726801 -0.106953578370738 -0.073095886609401 -0.991573458415704 0.40111095417782 0.909364503541099 -0.110300508330691</xcr:Rotation>
<xcr:Position>-0.376234434617799 -1.10296959718582 0.0173089683517212</xcr:Position>
<xcr:DistortionCoeficients>0.141475756891208 -0.416891955868309 1.5343574037034 0 0.00675579173524334 0.000382884616231682</xcr:DistortionCoeficients>
</rdf:Description>
</rdf:RDF>
</x:xmpmeta>
–snip–

Did you have any thoughts about this?

I’m also interested in this, for the same reasons that Malcolm described.
Any chance that you could provide more information on how we can recreate the distortion from the relevant xmp data?

Very interested in this as well, for the same reasons!
We’ve gotten pretty close to reproducing the undistortion outside of RC, but so far weren’t able to get a perfect match.

A thorough documentation of your process would be invaluable to us - both the lens model and any related steps such as centring and cropping the images (i.e., the influence of the “Fit” option).

Hello Malcolm.

Upcoming RC release (DEMO already released) will be able export undistorted 16b/32bit (incl float) “layer”.

It will support EXR and TIF float/logluv.
So new workflow for linear/hdri will required 2 set of images from RAW’s - 32bit EXR/TIF and 8-16Bit for Processing in RealityCapture. And on export stage it will be possible export mesh and cameras + indistorted 16/32bit images from “second layer”.

Other solution use any tools that can use provided in XMP camera, lens and undistortion settings. And rcinfo file that stored mesh coordinate system and all other information.

Hi,
I tried this new workflow in the new 1.0.2.2810 release and it’s not working for me.
I have a set of JPEGs and identically named EXRs in the same folder. I’m importing the JPEGs and use them for processing.
The EXRs are showing up as the second layer in the export dialog (see screenshot), everything looks great, but then I’m getting the error “Feature not implemented”. Same thing if I try to export 16bit TIFFs using the second layer instead of EXRs.

(Apologies for hijacking your thread Malcolm, I believe we are after the same thing so I hope it’s okay :slight_smile: )

// Simon

Sorry to bump this again, am I just doing this wrong or is it a bug that I should report?

I’m mostly concerned with the details of how these parms are used to undistort an image.

As this would help us integrate into a much larger pipeline.

DistortionModel = brown3t2
FocalLength35mm = 51.5750976017777
PrincipalPointU = 0.0208924261163548
PrincipalPointV = -0.00409728240298516
DistortionCoeficients = 0.141475756891208 -0.416891955868309 1.5343574037034 0 0.00675579173524334 0.000382884616231682

The confusing thing is the number of DistortionCoeficients as I would expect 5 not 6. ie K1, K2, K3, T1, T2

xd = xu (1 + K1 r^2 + K2 r^4 + K3 r^6) + (T2 (r^2 + 2 xu^2) + 2 T1 xu yu)
yd = yu (1 + K1 r^2 + K2 r^4 + K3 r^6) + (T1 (r^2 + 2 yu^2) + 2 T2 xu yu)

In the other case of DistortionModel = brown3 there is still 6 coefficients with the last 3 being set to 0 0 0? eg.

DistortionModel = brown3
FocalLength35mm= 48.360690057966
PrincipalPointU= -0.00029736149965627
PrincipalPointV= -0.00508353782437917
DistortionCoeficients = -0.0181569099033021 0.278771153561939 -0.846010943800427 0 0 0

I guess these first 3 coefficients are K1 K2 K3?

In the brown3t2 case is the 4 coefficients just a pad? ie.

DistortionCoeficients = 0.141475756891208 -0.416891955868309 1.5343574037034 0 0.00675579173524334 0.000382884616231682

K1 = 0.141475756891208
K2 = -0.416891955868309
K3 = 1.5343574037034
… = 0
T1 = 0.00675579173524334
T2 = 0.000382884616231682