following Lens calibration tut I created many Export Lens data (as presets) for my camera (and iphone…) lenses utilizing a lens grid shooted with every lensI have.
I made these presets for AE (as Mocha Lens for After Effects) and Nuke (Distortion Map Clip - Undistort and Distort) and I’ll use them to undistort or distort CGI in compositing.
But how can I re-use them to set lens distortion for every new mocha tracking?
I mean, if I have to make lens calibration BEFORE tracking (that should be always suggested), I should load the presets I’ve already done for the lens used, and than track it. But I don’t know how to make it… or maybe, we have to make every time a new calibration (using am imported Lens grid shooted with lens in use) even if I have already saved my lens distortion presets?
I think this is strange… seems to me rather than the process of Lens correction needs only to save the lens distortion map and does not need to tracking. I am wrong?
Many thanks for a reply.
For your records, you can find a breakdown of the lens tool here: http://www.imagineersystems.com/support/documentation/#The_Lens_Module
But it seems like what you are asking is how to export and import what you have done in the lens tool previously? In mocha Pro, all you have to do is import the distortion map clips.
Exporting Lens Data
The Lens Module provides different exports for getting your lens data out to other applications.
Distortion Maps (mocha Pro only): This format will render a map for programs that support color-based displacement or distortion (such as UV or STMaps). This is also useful if you want to save a calibration so it can be used on another shot, by importing the Distortion Map back into mocha. By default the Distortion Map will only render 1 frame, unless you have an animated distortion calibrated in mocha. Distortion Maps may also generate a map larger than your footage dimensions in order to accommodate overscan of the distortion.
- Click on Export Lens Data in the Lens Module or the File menu
- Select “Distortion Map” in the drop down
- The dimensions of the distortion map will be automatically calculated at a larger size to your footage to make sure there is enough overscan for correct distortion.
- The frame range is automatically set to only render 1 frame unless you have an animated distortion.
- Choose whether you want to render a map to Undistort or Distort with the radio buttons on the right
- Choose a destination folder for the image
- Distortion maps must be 32 bit floats, so TIF or DPX will be the best options
- Click “Save”
- Load the Distortion Map into the program of your choice
Importing your maps back into mocha:
- Go to the “Distortion Map” tab on the left side of the Lens Module
- Use the “Undistort (Inverse)” and “Distort (Direct)” drop downs to import your maps files
- Click on the Calibration dropdown and select “Distortion Map”
- To check the distortion, turn on your grid
- You can now choose to render out the distortion, or use the current calibration to assist your tracking and insertion workflow, as you would a line calibration.
- Keep in mind the hard boundaries of the Distortion map being imported may affect the tracking of your shot.
Note that You cannot export Lens Data with a Distortion Map calibration. You will only be able to perform track and render operations.
Please let me know if you have any questions and I will be happy to help.
Okay, now is all right.
Anyway I had many trouble to set up a correct lens calibration to create a presets for iPhone 4s lens on board.
I followed exactly the tuts suggested (by Martin Bennard):
import lens grid cilp filmed with iphone, make lens calibration by Locate line, new lines (I selected ALL grid lines…) and set 1 parameter:
The result was not credible… better with 2 - parameters, but still not credible for a lens as iPhone 4S (4,28mm alias 35mm Full frame).
I saved anyway all Disortion map clips (Distort and undistort, 1 parameter and 2 parameter…).
I attach one still frame from my lens grid clip filmed with iPhone and maybe you can tray to calibrate it and to see that the calibration doesen’t work (essentially, it creates a big distortion for a 35mm lens…): Dropbox - File Deleted
Shortly, now is all clear the process to create save and use again presents lens distortion map.
But about create a correct lens distortion I have serious doubts but maybe I’m doing something wrong:(.
I share some image to check what I’ve done:
This grid deformation is not credible… and in fact, when I make a corner pin, it doesn’t match the real distortion of the plate.
You’re not using equidistant lines though, are you? Also, is that an anamorphic lens?
Hi Mary, of course I used equidistant lines and lens is not Anamorphic. It it a iPhone onboard lens.
OK, don’t use equidistant lines, as they are not equidistant.
Okay, but I had only followed the msrtin’s tutirial about. Let me try without equidistant lines. Many thanks!
Right, but Martin’s tutorial used equidistant lines, and your grid is not “square.” That’s what’s probably throwing it off.
Uhm, You are right!
I used a grid of rectangles … instead should be square. … Damn!
Okay, I try with a square grid!