Lens distortion analysis

Anyone still use lens distortion analysis in lens distort node in flame?

I haven’t been into that node in years. What does the analysis do @johnt ?

All of our lens mapping happens in Nuke.

You can draw some lines (say on a grid) and have it “accurately” undo the distortion. However, the filtering is a little soft.

I don’t really have a copy of nuke anymore. Only flame.


I might find some time today to do a comparison. We have just processed a load of lens grids @johnt

1 Like

The inverse button is a little sticky.

Ok so I’m new to automatic lens correction so beware dumb questions to follow.

If you dont have any lens data is it possible to draw a grid over the image then put it through something in Flame.

Whats the goto method undistort - track - redistort

Nuke does a pretty good job with its auto analyzer.

The one in flame needs some straight edges to measure: I have used it and got some good results but it is pretty hit and miss.

3de is excellent. However I find the user interface very intimidating (it’s very Unix).

1 Like

Yeah the first thing is a lens grid. Regardless of the lens data.
But obviously it does help to know what lens you are mapping so that you can apply that STmap to all other shots.

You can get undistort information from doing a camera track but we are trying to get away from doing this and getting lens grids upfront and making sure we undistort before we track

Syntheyes does a great job of estimating it. You need footage with a sort of roving camera movement, but it can do it where a lens grid hasn’t been shot.


Usually I try to get geometry and a lensgrid, as even lensgrids arent perfect.

In fact I do not do any grids in Nuke or flame, I only use 3DE to calculcate accurate distortion and focal lengths.

You cant trust lensgrids, have you tried making a grid or mounting it properly anywhere? its insanely difficult to get right / straight, even places you would suspect have perfect grids - do not.

You also can not trust focal length readings, focal length changes with breathing and a lot of times its not 24mm but 23.76 or whatever.

In 3DE you would use the grid as a baseline, ideally you shoot “modern” or angled lens grids to derive the actual focal length, this gets really difficult with breathing lenses and anamorphics.

you then track in points, line up the set LiDar scan (with the new iPhones there really isnt a excuse to not get lidar from every scene, honestly takes like 30 seconds) . and then project the points onto the geometry.

finally you solve the actual lensdistortion parameters and focal length from the points you have projected onto the geometry.

From 3DE you can export a Nuke LensDistortion Node (maybe something for flame also, not sure) and then you make ST-Maps (UV maps) and use them downstream… oh and dont forget about rolling shutter!

this is the proper-proper way, overkill? Maybe , but at least now I know i wont get any issues downstream


Last time I used it years ago, it would happily generate an undistorted file whose resolutions weren’t divisible by 4, and therefor crash Flame. My advice is Just Don’t™. I’ve been handling all my lens distortion/undistortion via PFTrack with STMaps ever since.


We had lens grids however the camera logs didn’t record this shot. Lens distort didn’t really work. Used 2pt track and bicubic.

1 Like

For what it’s worth, I have a setup with a 5x5 (25 vertices) bicubic that inverts. Each point and all the tangents are connected via expressions to the UV’s of a separate bi-cubic. I’ve used it as an undistort/redistort effect. Down and dirty, so to speak. I’m happy to share if anyone wants it. Of course, I spent more time making it than I have using it, but I learned a few things on the way.


I use it from time to time, but it’s a lot more of a “maybe this sticks” than any thoughtful process.

I’m a lot more likely to get a “good enough” track and then do some 2d tracking and warping to get it to cross the finish line.

Yeah. I wasn’t impressed with the lens distort node yesterday.

1 Like

I don’t know how, but I’ve managed to Flame for 20+ years and have yet to do the undistort/track/distort process. I guess I tried it long ago, found it not so great, and just always figure out a way to make it work. Maybe I’ll give it another spin.


3D tracking packages do a good job of getting UVs then removing the lens distortion makes the tracking a breeze.

Agreed, the filtering is not kind!

One thing for which I’ll occasionally use Lens Distort is to flatten out a plane’s perspective in a shot (say the side of a product box, a freeway billboard, etc.) Switch the node to Perspective and Rectify and you can move the UV vertices to remove the perspective.

Definitely there are other ways to do the same thing but I find this to be one of the quickest.

edit: spelling

Infesting tip. Thanks.

The trick with the flame lensdistort node is to increase your canvas size prior to undistorting. If you don’t do this you can’t effectively use the rectify correctly. That being said, like other people mentioned its filtering is bad and 3rd party tracking software have better tools that also use 32bit STmaps or other native setups for Nuke etc.