A new version of Cineversity has been launched. This legacy site and its tutorials will remain accessible for a limited transition period

Visit the New Cineversity
   
 
Reverse Lens Distort for Projection Mapping
Posted: 14 August 2018 06:46 AM   [ Ignore ]  
Total Posts:  2
Joined  2014-09-09

Hello Forum,

I can’t believe I’m the only person to have this issue but can’t find any discussion about it, so here goes…

I’m creating a projection mapped animation from some locked camera footage of city buildings. I have used the lens distortion tool to successfully correct for wide angle lens distortion. I have then fed this into a camera calibration tag and got a really nice camera solve. However, here’s the problem…

I want to use the CORRECTED footage as an image source for projection mapping onto geometry, because it now has straight lines that will camera map nicely onto simple primitives. But I can’t find out how to do this as the corrected image only seems to appear as a non-rendering foreground image while I have the calibration tag selected in the object manager. Using the original footage is no good as it’s all curvy, when I need nice straight image lines for mapping.

All examples I find of the lens distortion tool simply use it to REDISTORT rendered geometry so it matches onto distorted background footage. I’ve seen no one trying to use it for projection mapping, which would be REALLY useful!

I know there are ways of undistorting footage outside of C4D but this workflow is more elegant as it can account for lens distortion in the camera calibration process making for a better solve. I basically just want a way of using the lens profile file for undistorting rather than redistorting.

Any help would be greatly appreciated.

David T

Profile
 
 
Posted: 14 August 2018 02:08 PM   [ Ignore ]   [ # 1 ]  
Administrator
Avatar
Total Posts:  12043
Joined  2011-03-04

Hi David T.,

Yes, since I write here in a forum, let me expand here a little bit. Camera projection should be always be based on distortion-free footage or images. To start with a lens that allows for work without any un-distortion process should be preferred. Any move of a pixel other than a pixel distance in vertical or horizontal direction will keep the quality, which will not work for lens-distortion of course. Any other movement of any pixel will reduce the quality quite impressively.

However, typically there is always a little bit or even a strong amount inside of the footage or the images.

Please have a look here:
https://help.maxon.net/us/#XPHLENSDISTORTIONSHADER

The simple answer is, it is based on the Lens Profile and will allow for a better quality than to first un-distort and use a baked version of it. (Some artists use a sharpening after the quality loss, which renders the images even less usable, to keep it as it is and change it during rendering might be the better way.

All the best

 Signature 

Dr. Sassi V. Sassmannshausen Ph.D.
Cinema 4D Mentor since 2004
Maxon Master Trainer, VES, DCS

Photography For C4D Artists: 200 Free Tutorials.
https://www.youtube.com/user/DrSassiLA/playlists

NEW:

NEW: Cineversity [CV4]

Profile
 
 
Posted: 15 August 2018 10:08 AM   [ Ignore ]   [ # 2 ]  
Total Posts:  2
Joined  2014-09-09

Thanks so much for getting back to me with a clear response!

I had never noticed the lens distortion shader before but the workflow makes perfect sense. The only slightly annoying thing I’ve found is that my viewport won’t display a background object’s texture if it has a lens distortion shader applied. So I have to use a geometry plane instead for a full backdrop. But that’s only a minor problem!

All the best

David T

Profile
 
 
Posted: 15 August 2018 01:57 PM   [ Ignore ]   [ # 3 ]  
Administrator
Avatar
Total Posts:  12043
Joined  2011-03-04

You’re very welcome, David T!

The Inter-active Render Region (option/alt+R) could help here, but yes, it solves a problem by creating a new one. So, perhaps with a few extra clicks, this one might work better:

You could create a second Background, see scene file, and render it.

Scene file
https://www.amazon.com/clouddrive/share/dKNJInV7TW4Dj4npmmtIr99eMqDa49Wa8GJr3YRqyUN

I think you will be happier with the polygon object than with the back-ground object on the long run (for camera projection).

My best wishes for your project

 Signature 

Dr. Sassi V. Sassmannshausen Ph.D.
Cinema 4D Mentor since 2004
Maxon Master Trainer, VES, DCS

Photography For C4D Artists: 200 Free Tutorials.
https://www.youtube.com/user/DrSassiLA/playlists

NEW:

NEW: Cineversity [CV4]

Profile