open all | close all

Lens Distortion

镜头失真

Image 图片Lens Distortion 镜头失真

Lens Distortion

镜头失真

General

常规

Lens distortions are difficult to avoid entirely when using optical recording devices (in contrast to the cameras in 3D applications such as Cinema 4D). These are especially common in conjunction with small focal lengths, i.e., wide angles. This effect is, however, welcome when using fisheye and anamorphic lenses, etc.

当使用光学记录设备时,镜头的扭曲是很难完全避免的(相对于3D 应用中的相机,如 Cinema 4D)。这些特别常见与小焦距,即广角。这种效果,然而,欢迎使用鱼眼和变形镜头等。

Such lens distortions can, for example, be problematic for motion tracking. Motion tracking works best when the live footage is free from any lens distortion.

例如,这样的镜头扭曲可能会成为运动跟踪的问题。运动跟踪工程最好的时候,现场胶片是免费的任何镜头失真。

Most of the unwanted distortions are barrel or pillow-shaped distortions:

大多数不希望出现的扭曲是桶形或枕形扭曲:

Left no lens distortion; center barrel-shaped distortion; right pillow-shaped distortion. 左边无镜头畸变; 中心桶状畸变; 右边枕状畸变

The farther away a point in the image lies from the center the more it will be distorted.

图像中的一个点离中心越远,它就会越扭曲。

The live footage that you feed into the Motion Tracker object (or Camera Calibrator tag) most often has a barrel-shaped distortion. This can lead to a failure of motion tracking or of calibration. In such an event, the distortion must be removed from the footage. During the final rendering, if 3D objects had been adapted, the same degree of distortion must be added so the 3D objects match the footage (unless you use the undistorted material during rendering, e.g., on a background object. However, this is not desired in most cases.).

你饲料到运动跟踪对象(或摄像机校准器标签)活镜头最经常有桶形失真。这可能导致运动跟踪或校准失败。在这种情况下,必须从录像中去除失真。在最终的渲染过程中,如果3D 对象已经被改编,那么必须添加相同程度的失真,这样3D 对象才能匹配连续镜头(除非你在渲染过程中使用未失真的材质,例如在背景对象上)。然而,这在大多数情况下是不被需要的。).

This is why Cinema 4D lets you distort or un-distort based on a previously defined lens profile using the following functions:

这就是为什么 Cinema 4D 可以让你根据之前定义的镜头轮廓使用以下功能进行扭曲或去扭曲:

Which function you use when depends on the workflow you use. For each, the lens profile must first be determined using the Lens Distortion tool. This profile can be loaded into all aforementioned functions.

什么时候使用什么功能取决于您使用的工作流程。对于每一个,镜头的轮廓必须首先确定使用镜头畸变工具。此配置文件可加载到上述所有函数中。

It should be noted that measures for accommodating the lens distortion must NOT be used in all cases. If Motion Tracking/Camera Calibrator works fine without such a measure then you don’t need to worry about lens distortion! However, when working on projects that must meet the highest standards (e.g., motion tracking for films in which the smallest distortion of a 3D object would be visible), these measures will be imperative.

应该指出的是,不能在所有情况下都采用适应镜头畸变的措施。如果运动跟踪/摄像机校准工程罚款没有这样的措施,那么你不需要担心镜头失真!然而,当工作项目必须符合最高标准(例如,运动跟踪的影片,其中最小的失真的3D 对象将是可见的) ,这些措施将是必要的。

Generally speaking, the following can be said:

一般来说,可以说:

  • Very minor distortions can be ignored. However, if the distortion should nevertheless be removed and a good, accurate lens profile is available, the motion tracking result will be somewhat better. 极小的扭曲是可以忽略的。然而,如果畸变仍然应该消除和一个良好的,准确的镜头配置文件,运动跟踪结果将有所改善
  • If the lens distortion is extreme enough that it is noticeable on the source footage, a lens profile should definitely be applied. 如果镜头扭曲是极端的,它是显而易见的来源胶片,一个镜头配置文件一定要应用
In the image above two traffic signs were positioned in front of a background with obvious lens distortion. At left rendered without compensating for the lens profile, at right with. 在上面的图像中,两个交通标志被放置在一个背景前面,有明显的镜头失真。在左边渲染没有补偿的镜头配置,在右边

Lens Distortion

镜头失真

The Lens Distortion tool comes into play when dealing with lens distortion effects in Cinema 4D. This tool is used to create interactive lens profiles that uses various lens models (radial, anamorphic, fisheye) to numerically describe, save and output aberrations at different locations (as described here).

镜头失真工具进入发挥时,处理镜头失真的影响在Cinema 4d。这个工具用于创建交互式镜头配置文件,使用各种镜头模型(径向,变形,鱼眼)数值描述,保存和输出在不同的位置的像差(如此处所述)。

The Lens Distortion tool is applied when an image or video (ideally created using the same camera and focal length as the grid) is loaded. This will then be displayed in the Viewport. Next, interactive guides are then created at linear image edges. There are two ways of un-distorting the image (to be defined in the Lens Distortion tab):

镜头失真工具是应用时,一个图像或视频(理想地创建使用相同的照相机和焦距作为网格)是加载。然后,这些照片将在 Viewport 展出。接下来,在线性图像边缘创建交互式指南。有两种方法可以使图像不失真(在镜头失真标签中定义) :

  • Manual: The tool’s settings are adjusted/fine-tuned until the guides match the image edges. This method is designed for use by experienced users. 手动: 工具的设置被调整/微调,直到导轨与图像边缘匹配。这种方法是为有经验的用户设计的
  • Automatic: The guides are positioned with several points along the distorted, i.e., curved, edges (as evenly distributed as possible). When the function is executed, the guides and those of the underlying image will be straightened and the lens profile will be created. This is the simpler and also the recommended method. 自动: 导轨的位置沿着扭曲的,即,弯曲的,边缘(尽可能均匀分布)。当函数执行时,导轨和底层图像的导轨将被拉直,并且镜头轮廓将被创建。这是比较简单的方法,也是推荐的方法

Interactivity

互动性

Guides that are created can be adjusted at their points or segments. The following keys can be used:

创建的导轨可以在它们的点或段上进行调整。可以使用以下键:

  • Ctrl/Cmd +click to duplicate guides + 点击复制指南
  • Ctrl/Cmd +click once on a guide to add a new point + 点击一下指南,添加一个新点
  • Backspace/Del to delete a selected point. Selected guide segments can also be deleted. 删除选定的点。选定的指南段也可以删除

Example

例子

Foto: Erin Harner. 图片来源: Erin Harner

In the image above you can see where guides can be positioned. Generally speaking, the more (precise) guides that are used, the better. If guides can be positioned across the entire image this would be ideal. However, a single guide that is positioned completely wrong (e.g., one that lies on an edge that is in fact curved) can lead to an unusable result. Several parallel guides that lie close together in one region are not as effective if other image regions have no guides at all. The lens distortion can be calculated very accurately at locations at which there are many guides but other regions without guides can be calculated incorrectly. This is why it really helps to include a camera-specific grid for lens calibration!

在上面的图片中,你可以看到指南可以放置在哪里。一般来说,使用的(精确的)导轨越多越好。如果指南可以定位在整个图像这将是理想的。然而,如果一个导轨的位置完全错误(例如,一个导轨位于事实上是弯曲的边缘上) ,就可能导致无法使用的结果。如果其他图像区域根本没有指南,那么在一个区域内紧密相连的几个平行指南就不那么有效了。在有许多导轨但其他没有导轨的区域,可以非常准确地计算出镜头畸变。这就是为什么它真的有助于包括一个相机特定的网格镜头校准!

As you can see, the final, undistorted image is larger than the original image. To rectify this you can, for example, modify the Image Scale or Image Offset X/Y values so that the original format is restored. Depending on your workflow, these settings can be made to match those of the Lens Distortion shader or the Lens Distortion post effect’s values to make sure that all values line up.

正如你所看到的,最终的无失真图像比原始图像大。为了纠正这一点,您可以修改图像缩放或图像偏移 X/Y 值,以便还原原始格式。根据您的工作流程,这些设置可以匹配那些镜头失真着色器或镜头失真AE的价值观,以确保所有的价值观一致。