# Lens distortion analysis

**URL:** <https://forum.logik.tv/t/lens-distortion-analysis/4862>\
**Category:** Flame Questions\
**Created:** [January 17, 2022, 7:12pm UTC](https://forum.logik.tv/t/lens-distortion-analysis/4862 "2022-01-17T19:12:48Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![johnt](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.logik.tv/johnt/32/14040_2.png) [@johnt](https://forum.logik.tv/u/johnt)\
**Post date:** [January 17, 2022, 7:12pm UTC](https://forum.logik.tv/t/lens-distortion-analysis/4862/1 "2022-01-17T19:12:48Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![PlaceYourBetts](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.logik.tv/placeyourbetts/32/6852_2.png) [@PlaceYourBetts](https://forum.logik.tv/u/PlaceYourBetts)\
**Post date:** [January 17, 2022, 7:14pm UTC](https://forum.logik.tv/t/lens-distortion-analysis/4862/2 "2022-01-17T19:14:20Z")

</div>

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

All of our lens mapping happens in Nuke.

---

<div class="post-metadata">

**Author:** ![johnt](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.logik.tv/johnt/32/14040_2.png) [@johnt](https://forum.logik.tv/u/johnt)\
**Post date:** [January 17, 2022, 7:16pm UTC](https://forum.logik.tv/t/lens-distortion-analysis/4862/3 "2022-01-17T19:16:21Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![PlaceYourBetts](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.logik.tv/placeyourbetts/32/6852_2.png) [@PlaceYourBetts](https://forum.logik.tv/u/PlaceYourBetts)\
**Post date:** [January 17, 2022, 7:18pm UTC](https://forum.logik.tv/t/lens-distortion-analysis/4862/4 "2022-01-17T19:18:14Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![johnt](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.logik.tv/johnt/32/14040_2.png) [@johnt](https://forum.logik.tv/u/johnt)\
**Post date:** [January 17, 2022, 7:20pm UTC](https://forum.logik.tv/t/lens-distortion-analysis/4862/5 "2022-01-17T19:20:04Z")

</div>

The inverse button is a little sticky.

---

<div class="post-metadata">

**Author:** ![johnag](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.logik.tv/johnag/32/573_2.png) [@johnag](https://forum.logik.tv/u/johnag)\
**Post date:** [January 17, 2022, 10:48pm UTC](https://forum.logik.tv/t/lens-distortion-analysis/4862/6 "2022-01-17T22:48:07Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![johnt](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.logik.tv/johnt/32/14040_2.png) [@johnt](https://forum.logik.tv/u/johnt)\
**Post date:** [January 17, 2022, 10:52pm UTC](https://forum.logik.tv/t/lens-distortion-analysis/4862/7 "2022-01-17T22:52:00Z")

</div>

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).

---

<div class="post-metadata">

**Author:** ![PlaceYourBetts](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.logik.tv/placeyourbetts/32/6852_2.png) [@PlaceYourBetts](https://forum.logik.tv/u/PlaceYourBetts)\
**Post date:** [January 18, 2022, 5:30am UTC](https://forum.logik.tv/t/lens-distortion-analysis/4862/8 "2022-01-18T05:30:04Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![RufusBlackwell](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.logik.tv/rufusblackwell/32/422_2.png) [@RufusBlackwell](https://forum.logik.tv/u/RufusBlackwell)\
**Post date:** [January 18, 2022, 6:22am UTC](https://forum.logik.tv/t/lens-distortion-analysis/4862/9 "2022-01-18T06:22:57Z")

</div>

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.

[![](https://us1.discourse-cdn.com/flex020/uploads/thedepartmentofexternalservices/original/2X/1/1e37f5c48362f6d22d84b4176c1b498239f1ee2f.jpeg "New Lens Solving Features in SynthEyes 1806") ](https://www.youtube.com/watch?v=nZl2Ns5uIj8)

---

<div class="post-metadata">

**Author:** ![finnjaeger](https://avatars.discourse-cdn.com/v4/letter/f/e99b99/32.png) [@finnjaeger](https://forum.logik.tv/u/finnjaeger)\
**Post date:** [January 18, 2022, 10:54am UTC](https://forum.logik.tv/t/lens-distortion-analysis/4862/10 "2022-01-18T10:54:38Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![hBomb42](https://avatars.discourse-cdn.com/v4/letter/h/bbce88/32.png) [@hBomb42](https://forum.logik.tv/u/hBomb42)\
**Post date:** [January 18, 2022, 3:21pm UTC](https://forum.logik.tv/t/lens-distortion-analysis/4862/11 "2022-01-18T15:21:51Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![johnt](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.logik.tv/johnt/32/14040_2.png) [@johnt](https://forum.logik.tv/u/johnt)\
**Post date:** [January 18, 2022, 3:25pm UTC](https://forum.logik.tv/t/lens-distortion-analysis/4862/12 "2022-01-18T15:25:33Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ytf](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.logik.tv/ytf/32/109_2.png) [@ytf](https://forum.logik.tv/u/ytf)\
**Post date:** [January 18, 2022, 4:10pm UTC](https://forum.logik.tv/t/lens-distortion-analysis/4862/13 "2022-01-18T16:10:56Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![andy\_dill](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.logik.tv/andy_dill/32/15475_2.png) [@andy\_dill](https://forum.logik.tv/u/andy_dill)\
**Post date:** [January 18, 2022, 6:13pm UTC](https://forum.logik.tv/t/lens-distortion-analysis/4862/14 "2022-01-18T18:13:22Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![johnt](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.logik.tv/johnt/32/14040_2.png) [@johnt](https://forum.logik.tv/u/johnt)\
**Post date:** [January 18, 2022, 6:45pm UTC](https://forum.logik.tv/t/lens-distortion-analysis/4862/15 "2022-01-18T18:45:14Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![GPM](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.logik.tv/gpm/32/4224_2.png) [@GPM](https://forum.logik.tv/u/GPM)\
**Post date:** [January 19, 2022, 3:28pm UTC](https://forum.logik.tv/t/lens-distortion-analysis/4862/16 "2022-01-19T15:28:30Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![johnt](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.logik.tv/johnt/32/14040_2.png) [@johnt](https://forum.logik.tv/u/johnt)\
**Post date:** [January 19, 2022, 3:32pm UTC](https://forum.logik.tv/t/lens-distortion-analysis/4862/17 "2022-01-19T15:32:53Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![johnt](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.logik.tv/johnt/32/14040_2.png) [@johnt](https://forum.logik.tv/u/johnt)\
**Post date:** [January 20, 2022, 7:45am UTC](https://forum.logik.tv/t/lens-distortion-analysis/4862/19 "2022-01-20T07:45:09Z")

</div>

Infesting tip. Thanks.

---

<div class="post-metadata">

**Author:** ![Jeroenvb](https://avatars.discourse-cdn.com/v4/letter/j/ba8739/32.png) [@Jeroenvb](https://forum.logik.tv/u/Jeroenvb)\
**Post date:** [January 20, 2022, 12:14pm UTC](https://forum.logik.tv/t/lens-distortion-analysis/4862/20 "2022-01-20T12:14:25Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![GPM](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.logik.tv/gpm/32/4224_2.png) [@GPM](https://forum.logik.tv/u/GPM)\
**Post date:** [January 20, 2022, 2:59pm UTC](https://forum.logik.tv/t/lens-distortion-analysis/4862/21 "2022-01-20T14:59:32Z")

</div>

It would be great to see a video of this. Probably already exists somewhere.

[Next page](https://forum.logik.tv/t/lens-distortion-analysis/4862.md?page=2)
