DJI P4 RTK camera dewarp metadata

Hi,

I’m new to ODM (testing with WebODM container on an Ubuntu box and just bought Piero Toffanin’s book) and I also have a DJI Phantom 4 RTK drone.

This drone includes factory-calibrated metadata in its JPG survey images, for example:

Dewarp Data                     :  2018-10-18;3685.600000000000,3679.070000000000,-11.820000000000,-0.500000000000,-0.265548000000,0.108746000000,0.000233438000,0.000097564200,-0.030996200000
Dewarp Flag                     : 0

Q. How do I ensure that this data is incorporated into the ODM processing pipeline?

I figure that this data should be read when the photo dataset is first loaded and parsed, and that if the image has not already been dewarped (Dewarp Flag: 0) then the photos should be distortion-corrected prior to subsequest processing (in sfm stage).

If this is not handled in ODM pipeline, I will process the files externally (perhaps using something like OpenCV similar to GitHub - dronemapper-io/dji-dewarp: OpenCV Tool to Correct and Apply Distortion Dewarp to DJI Drone Images via EXIF Tags.), before I load into ODM.

Any guidance much appreciated, and thanks for integrating an amazing set of software packages!

Tom

1 Like

Further to my original post, here is the cameras.json that I got from a non-RTK (GNSS) test-flight where I mapped a small section of agricultural field and road from the same camera (just loading the JPGs directly to ODM without undistorting myself). I find it interesting that some of the k1,k2,p1,p2,k3 parameters are in the right ball-park (similar to factory Dewarp Data as far as I can see):

{
    "dji fc6310r 5472 3648 brown 0.6666 rgb": {
        "projection_type": "brown",
        "width": 5472,
        "height": 3648,
        "focal_x": 0.6693423277306177,
        "focal_y": 0.6693423277306177,
        "c_x": -0.0035379791883498692,
        "c_y": 0.0015473478650913344,
        "k1": -0.2626729106874314,
        "k2": 0.10379201909232937,
        "p1": -0.0001617670183198713,
        "p2": 0.00031441728719545735,
        "k3": -0.027620387873774074
    }
}
1 Like

I suppose what I’m asking is:

  • Should I manually extract/use the dewarp (brown) parameters that my drone embeds in the JPG metadata, and then use this in a cameras.json file?

  • Or does can ODM use the JPG metadata directly?

1 Like

You’ll have to create your own cameras.json file and upload with the images.

Pretty snazzy it comes with its own factory calibration. It would be interesting to compare are use of this with an automatically derived one.

1 Like

Thank you!

I’ll just try plugging the factory values into my cameras.json and see how things go.

Does anyone know if these camera parameters (in the JSON) are used as a starting point for further optimisation, or as a fixed model?

I haven’t yet started to dig into the details of each processing stage…I literally got this drone a few weeks ago and I want to see how far I can get with ODM. I’m working from the outside-in…and hope to contribute in some way to the community.

First impressions are that ODM and WebODM are just an amazing tool to get the workflow started. Thanks again to all the devs!

2 Likes

Excited to see what you learn!

Thanks for looking to contribute, as well!

1 Like

Approaching like this will make it a fixed model, so if the parameters are off, the model will be.

1 Like

(That said, it’s totally worth a try).

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.