New in Cinema 4D Release 17 Quickstart: Lens Distortion Tool for Undistorting Wide Angle Footage

Photo of Cineversity

Instructor Cineversity

Share this video
  • Duration: 06:37
  • Views: 14750
  • Made with Release: 17
  • Works with Release: 17 and greater

Create and save a 3DE lens distortion profile for use in the C4D R17 Motion Tracker, Lens Distortion Shader and Lens Distortion Post Effect

Use the Lens Distortion Tool in Cinema 4D Release 17 to create lens profiles that can be used in the Motion Tracker, Lens Distortion Shader and and Lens Distortion Post Effect. Learn how to load a lens grid into the tool and create n-side lines to auto solve the Lens Distortion values. You can also manually adjust the lens distortion values and add a line to evaluate the distortion. Finally, you'll save the profile for use elsewhere in Cinema 4D's Lens Distortion workflow.

show less

Transcript

In Cinema 4D R17 the motion tracker has been updated to incorporate a lens distortion workflow. When it comes time to track your footage, the lens distortion present in the footage can introduce significant error into the camera reconstruction. The first step in this process is using the lens distortion tool to generate a lens profile that can be used with the motion tracker, the lens distortion shader and the lens distortion post-effect to remove or add lens distortion as needed. By using a lens profile to remove lens distortion before tracking, you can get significantly better results during camera reconstruction. A lens profile can also be used at render time to distort scene geometries so that it matches the lens distortion in your footage. So, let's take a look at creating a lens profile. To create a lens profile, you're going to use the lens distortion tool. The lens distortion tool can be found in the tools menu under lens distortion. Once the tool is active in the attribute manager, you can click on the open file button to bring up your open file dialog. From here, you're going to want to select an image that has lens distortion present. In an ideal situation, you'll shoot a lens grid using the lens that you shot your footage with. In the case of our video, we used a GoPro 4 Hero and we also shot a lens grid. If you'd like more information about shooting a lens grid, check out the link in the description of this video. With the image loaded in the viewport, we can get started. We're going to go to the lens distortion tab and then choose the solve mode. There are two different methods for the solve mode: automatic and manual. Automatic is a great way to get most of the settings that you need correct and then you can switch to manual to adjust if needed. So, we're really gonna focus on automatic in this case. The first thing that we want to do is add an end point line. This is going to add a line with three points along it. We want to align the points on the line to dots on our grid. We want to pay close attention to the grid and make sure that the line is matching dots that all share the same row. In this case here, we can see that this point should actually some down one. Now, even with this little work done, we can choose a lens distortion model. The lens distortion model should match the type of lens that you were using as close as possible. In the case of the GoPro 4 Hero, we're using something similar to a radial fisheye lens. As soon as we select this lens distortion model you'll see some lens correction being applied to the footage inside the view port. Next, we can click on auto-solve. We'll see that these sliders in the attribute manager adjust to give us the general settings for the lens distortion. If we want a better view of this, we can go to the image tab and then scale the view using the image scale. If we zoom in, we can also hold down control plus shift and left click and drag in the viewport to move the view around so that we can get a closer look at our image. We can see currently that there's still quite a bit of distortion present in this image. The dots along this row should be lining up with our end point line, but they're not. So we're going to start by adjusting the positions of these a little bit more and adding in another reference line. So go back to lens distortion and set the model to none. Then we're going to zoom in a little bit and readjust our points, making sure that the points are lining up with the center of the dot as close as possible. And then click on full image to go back to the full view and we're going to create a duplicate of this line. To do that we'll hold down control and click and drag an existing point on the line. We can then readjust the points so that they line up with the proper row. Again, we can zoom in using the image scale attribute and then pan the view using control shift plus left click and drag. And those look pretty good so we'll go back to the full image. Set the lens distortion back to radial and auto-solve again. Now if we zoom out to check, we can see that things are looking a little bit better but they're still off in the center area here. So let's go ahead and zoom in and we're going to add some more points along the end point line. Set the lens distortion model to none and then we're going to count out a few dots along the row. One, two, three, four, five, six, seven. And then we can control click on the line to add a new point and readjust it's position. We'll do the same thing for the other side. One, two, three, four, five, six, seven control click and then move the point. We wanna do the same thing for the bottom. This time we'll just follow the column down, control click to add the point and reposition it and the same thing for this side. Follow the column down, control click and then move the point. We'll go back to our image tab, full image, lens distortion, radial fisheye and then auto-solve again. Now you can see that the dots on the grid match the end point line a lot better. We can go to the image, scale out a bit and we can see that there's a little bit of distortion there so we'll go to our lens distortion and we'll just roll back our sliders a little bit until we find the ones that are going to give us the best result. If we need to we can always click auto-solve and that's going to reset things back the way they were before we started adjusting these. And so again, we're just looking to make sure that the dots all line up. We can also go to manual mode and click add line. And this is going to give us a simple reference line that we can use while we're adjusting these sliders. So set this back to none and then change the position of this line so that it matches up with the column here. I'll go back to my radial fisheye and you'll see that that loads back in and now as I'm adjusting I have a better frame of reference for trying to line up these specific points vertically. Once I have something that looks more or less correct, I can then save the lens profile. So click on save lens profile and then we're going to give this a name. Preferably it should reference the exact lens that you were using so that you can use this profile later on with any other footage that was shot with that lens. In this case we'll just take the name of our lens grid and we'll use that. Now we're ready to take our lens profile and start using it in the rest of the lens distortion workflow.
In Cinema 4D R17 the motion tracker has been updated to incorporate a lens distortion workflow. When it comes time to track your footage, the lens distortion present in the footage can introduce significant error into the camera reconstruction. The first step in this process is using the lens distortion tool to generate a lens profile that can be used with the motion tracker, the lens distortion shader and the lens distortion post-effect to remove or add lens distortion as needed. By using a lens profile to remove lens distortion before tracking, you can get significantly better results during camera reconstruction. A lens profile can also be used at render time to distort scene geometries so that it matches the lens distortion in your footage. So, let's take a look at creating a lens profile. To create a lens profile, you're going to use the lens distortion tool. The lens distortion tool can be found in the tools menu under lens distortion. Once the tool is active in the attribute manager, you can click on the open file button to bring up your open file dialog. From here, you're going to want to select an image that has lens distortion present. In an ideal situation, you'll shoot a lens grid using the lens that you shot your footage with. In the case of our video, we used a GoPro 4 Hero and we also shot a lens grid. If you'd like more information about shooting a lens grid, check out the link in the description of this video. With the image loaded in the viewport, we can get started. We're going to go to the lens distortion tab and then choose the solve mode. There are two different methods for the solve mode: automatic and manual. Automatic is a great way to get most of the settings that you need correct and then you can switch to manual to adjust if needed. So, we're really gonna focus on automatic in this case. The first thing that we want to do is add an end point line. This is going to add a line with three points along it. We want to align the points on the line to dots on our grid. We want to pay close attention to the grid and make sure that the line is matching dots that all share the same row. In this case here, we can see that this point should actually some down one. Now, even with this little work done, we can choose a lens distortion model. The lens distortion model should match the type of lens that you were using as close as possible. In the case of the GoPro 4 Hero, we're using something similar to a radial fisheye lens. As soon as we select this lens distortion model you'll see some lens correction being applied to the footage inside the view port. Next, we can click on auto-solve. We'll see that these sliders in the attribute manager adjust to give us the general settings for the lens distortion. If we want a better view of this, we can go to the image tab and then scale the view using the image scale. If we zoom in, we can also hold down control plus shift and left click and drag in the viewport to move the view around so that we can get a closer look at our image. We can see currently that there's still quite a bit of distortion present in this image. The dots along this row should be lining up with our end point line, but they're not. So we're going to start by adjusting the positions of these a little bit more and adding in another reference line. So go back to lens distortion and set the model to none. Then we're going to zoom in a little bit and readjust our points, making sure that the points are lining up with the center of the dot as close as possible. And then click on full image to go back to the full view and we're going to create a duplicate of this line. To do that we'll hold down control and click and drag an existing point on the line. We can then readjust the points so that they line up with the proper row. Again, we can zoom in using the image scale attribute and then pan the view using control shift plus left click and drag. And those look pretty good so we'll go back to the full image. Set the lens distortion back to radial and auto-solve again. Now if we zoom out to check, we can see that things are looking a little bit better but they're still off in the center area here. So let's go ahead and zoom in and we're going to add some more points along the end point line. Set the lens distortion model to none and then we're going to count out a few dots along the row. One, two, three, four, five, six, seven. And then we can control click on the line to add a new point and readjust it's position. We'll do the same thing for the other side. One, two, three, four, five, six, seven control click and then move the point. We wanna do the same thing for the bottom. This time we'll just follow the column down, control click to add the point and reposition it and the same thing for this side. Follow the column down, control click and then move the point. We'll go back to our image tab, full image, lens distortion, radial fisheye and then auto-solve again. Now you can see that the dots on the grid match the end point line a lot better. We can go to the image, scale out a bit and we can see that there's a little bit of distortion there so we'll go to our lens distortion and we'll just roll back our sliders a little bit until we find the ones that are going to give us the best result. If we need to we can always click auto-solve and that's going to reset things back the way they were before we started adjusting these. And so again, we're just looking to make sure that the dots all line up. We can also go to manual mode and click add line. And this is going to give us a simple reference line that we can use while we're adjusting these sliders. So set this back to none and then change the position of this line so that it matches up with the column here. I'll go back to my radial fisheye and you'll see that that loads back in and now as I'm adjusting I have a better frame of reference for trying to line up these specific points vertically. Once I have something that looks more or less correct, I can then save the lens profile. So click on save lens profile and then we're going to give this a name. Preferably it should reference the exact lens that you were using so that you can use this profile later on with any other footage that was shot with that lens. In this case we'll just take the name of our lens grid and we'll use that. Now we're ready to take our lens profile and start using it in the rest of the lens distortion workflow.
Cinema 4D R17에서는 모션 트래커가 렌즈 디토션 워크플로우를 포함할 수 있도록 업데이트되었습니다. 여러분이 이미지를 트래킹할 때 화면에 존재하는 렌즈 디스토션은 카메라를 재 구성할 때 심각한 오류를 초래할 수 있습니다. 이 프로세스의 첫반째 단계는 렌즈 디스토션 툴을 사용하여 렌즈 프로파일을 생성하는 것으로서, 이 프로파일은 모션 트래커, 렌즈 디스토션 셰이더 및 렌즈 디스토션 포스트-이펙트와 함께 사용되어 필요에 따라 렌즈 디스토션을 추가하거나 제거할 수 있습니다. 트래킹하기전에 렌즈 디스토션을 제거하기 위하여 렌즈 프로파일을 사용함으로써, 카메라 재 구축 과정에서 매우 월등한 결과를 얻을 수 있습니다. 렌즈 프로파일은 또한 렌더링시에도 사용할 수 있어 씬 지오메트리들을 왜곡시켜 여러분의 오리지날 이미지의 렌즈 디스토션과 일치하도록 할 수 있습니다. 이제 렌즈 프로파일을 생성하는 과정을 살펴보도록 하겟습니다. 렌즈, 프로파일을 생성하기 위하여, 렌즈 디스토션 툴을 사용합니다. 렌즈 디스토션 툴은 툴 메뉴의 렌즈 디스토션 아래에 있습니다. 툴이 활성화되면, 속성 관리자 안에서 파일 열기 버튼을 클릭하여 파일 열기 대화창을 열 수 있습니다. 여기서 렌즈 디스토션이 있는 이미지를 찾아서 선택할 수 있습니다. 보다 이상적인 상황이라면, 여러분이 이미지를 촬영한 렌즈를 사용하여 렌즈 그리드를 촬영합니다. 이 비디오에서는 GoPro 4 Hero를 사용하였으며, 렌즈 그리드도 촬영하였습니다. 렌즈 그리드 촬영에 대하여 더 많은 정보가 필요할 경우에는 이 비디오의 설명에 나와있는 링크를 참조하십시오. 뷰포트에 로딩된 이미지를 가지고 시작하도록 하겠습니다. 렌즈 디스토션 탭으로 가서 solve 모드를 선택하도록 하겠습니다. 솔브 모드에는 자동과 수동의 두가지 서로 다른 방법이 있습니다. 자동은 여러분이 필요로하는 대부분의 설정들을 정확하게 얻을 수 있으며 그런 다음, 필요한 경우, 수동으로 전환하여 수정할 수 있습니다. 따라서 우리는 여기서 자동 모드에 촛점을 맞추도록 할 것입니다. 우리가 할 첫번째는 끝점 라인을 추가하는 것입니다. 이는 세개의 점을 따라 이루어지는 선을 추가하게 됩니다. 여기서 우리는 라인 상의 포인트들을 그리드 상의 도트에 일치시킵니다. 그리드를 자세히 보고, 라인이 같은 줄에 있는 도트들과 일치하도록 라인을 생성합니다. 여기서는 이 곳의 포인트가 실질적으로는 아래로 내려와야 되는 것을 알 수 있습니다. 이렇게 간단한 작업만으로도 렌즈 디스토션 모델을 선택할 수 있습니다. 렌즈 디스토션 모델은 여러분이 사용했던 렌즈의 유형과 가능한 가깝게 일치하여야 합니다. GoPro 4 Hero의 경우, 우리는 원형 어안렌즈와 유사한 것을 사용하였으며, 우리가 이 렌즈 디스토션 모델을 선택하면 뷰포트 내의 이미지에 렌즈 교정이 적용되는 것을 보실 수 있습니다. 그 다음, Auto-solve를 클릭합니다. 속성 관리자에 글라이더들이 있는 데 사용자들은 이를 이용하여 렌즈 디스토션에 대한 일반적인 설정들을 조정할 수 있습니다. 이 뷰를 더 잘 보이도록 하려면, 이미지 탭으로 가서 이미지 스케일을 이용하여 뷰를 스케일합니다. 줌인하려면, Ctrl과 Shift를 누른 채 뷰포트에서 레프트 클릭하고 드래그하여 뷰를 이동시켜 이미지를 더 가까이 볼 수 있습니다. 우리는 아직도 꽤 많은 양의 디스토션이 이 이미지에 존재하는 것을 볼 수 있습니다. 이 줄을 따라 도트들이 우리가 그린 엔드 포인트 라인에 맞도록 일치하여야 하는데, 그렇지 못하다는 것을 알 수 있습니다. 따라서, 이들의 위치를 조금 조정하고, 또 다른 레퍼런스 라인을 추가하도록 하겠습니다. 다시 렌즈 디스토션으로 되돌아 가서, 모델을 none으로 선택합니다. 그런 다음, 조금 줌인하여 포인트들을 다시 조정하고 포인트들이 도트의 중심에 가능한 가깝게 정렬되도록 합니다. 그런 다음, 전체 이미지를 클릭하여 전체 뷰로 가서 이 라인을 하나 복사합니다. 라인을 복사하려면 Ctrl을 누른 상태에서 라인 상의 포인트를 클릭하고 드래그합니다. 그런 다음, 포인트들을 다시 조정하여 도트 줄과 일치하도록 합니다. 이미지 스케일 속성을 이용하여 다시 줌인할 수 있고, Ctrl+Shift+레프트 클릭 드래그로 이미지를 패닝할 수 있습니다. 이렇게 하여 최대로 조정한 다음, 전체 이미지로 되돌아 갑니다. 렌즈 디스토션으로 되돌아가 래디얼로 설정하고 다시 auto-solve를 선택합니다. 이 상태에서 줌 아웃하여 확인해 보면 아까보다는 좀 나아진 것을 볼 수 있습니다. 그러나 이 곳을 보면 아직도 중심에서 벗어난 부분들이 있습니다. 다시 줌 인하여 엔드 포인트 라인을 따라 포인트들을 추가하도록 하겠습니다. 이를 위해 렌즈 디스토션 모델을 없음으로 하고 행을 따라 몇개의 도트들을 빼내도록 하겠습니다. 하나, 둘, 셋, 넷, 다섯, 여섯, 일곱. 여기서 엔드 포인트 라인을 Ctrl 클릭하여 새로운 포인트를 하나 추가하고 이 포인트의 위치를 조정합니다. 반대 쪽 라인에도 똑 같은 작업을 하겠습니다. 하나, 둘, 셋, 넷, 다섯, 여섯, 일곱. 그리고 엔드 포인트 라인을 Ctrl 클릭하고 포인트 위치를 조정합니다. 이와 동일한 작업을 이미지 아랫 부분의 엔드 포인트 라인에도 적용하겠습니다. 이번에는 맨 위의 일곱번째 도트와 같은 열에 있는 도트 부분에서 Ctrl 클릭하여 포인트를 추가하고 위치를 조정합니다. 동일한 방법으로 반대편 엔드 포인트에도 맨 위 일곱번째 도트에서 내려와 같은 열의 도트에서 Ctrl 클릭하고 추가된 포인트의 위치를 조정합니다.이제 이미지 탭의 전체 이미지로 되돌아가서, 렌즈 디스토션을 어안으로 선택하고 auto-solve를 다시 선택합니다. 이제 그리드상의 도트들이 엔드 포인트 라인과 훨씬 더 잘 일치하는 것을 볼 수 있습니다. 이제 이미지로 가서 약간 스케일을 줄이면 아직도 약간의 디스토션이 있는 것을 볼 수 있습니다. 그래서, 렌즈 디스토션으로 가서 슬라이더를 조금 롤백하여 최선의 결과가 나올 때까지 롤백합니다. 필요하다면, 언제든지 auto-solve를 선택하여 이 것들을 조정하기 전에 이들을 리셋시킵니다. 이렇게 하여 도트들이 모두 엔드 포인트 라인과 일치하도록 합니다. 또한 매뉴얼 모드로 가서, 라인 추가를 선택합니다. 그러면 이 슬라이더들을 조정하는 과정에서 사용할 수 있는 간단한 레퍼런스 라인이 주어집니다. 이제 디스토션 모델을 없음으로 다시 설정하고 이 라인의 위치를 조정하여 이 부분의 수직 열과 일치하도록 합니다. 다시 어안으로 설정하면, 어안이 다시 로드됩니다. 이제 이를 조정함으로써 이들 특정 포인트들을 수직으로 일직선으로 정렬시키기위한 더 나은 레퍼런스 틀을 얻게 되었습니다. 어느 정도 정확하게 되고 난 후에는, 이제 렌즈 프로파일을 저장할 수 잇습니다. Save Lens Profile을 클릭하고 이름을 부여합니다. 렌즈 프로파일 이름은 여러분이 사용한 렌즈를 레퍼런스로 사용하는 것이 좋습니다. 그러면, 나중에 동일한 렌즈로 촬영된 어떠한 이미지들도 이 프로파일을 사용할 수 있습니다. 여기서는 우리가 사용한 렌즈 그리드를 이용하여 이를 이름으로 사용하겠습니다. 이제 우리는 렌즈 프로파일을 취하여 이를 이용하여 나머지 렌즈 디스토션 워크플로우에 이를 사용할 수 있게 되었습니다.
Resume Auto-Scroll?