Camera
Calibrator
摄像机矫正
Basic 基础Image 图片Calibrate 校准Settings 设置Links 链接
Camera Calibrator
摄像机矫正
Thanks to the calibrated camera, squash-playing
monsters can be composited convincingly into real-world photos. 由于校准的相机,打壁球的怪物可以合成到现实世界的照片令人信服
A common task for almost every 3D artist is compositing rendered objects into real-world scenes - stills or
animations. A major problem when doing this is the unknown camera angle with which the real-world material was
created - in particular perspective and focal length. These settings must also be reflected in the
Cinema 4D camera that is used to render the 3D objects. Only if these settings match can the 3D objects
be composited convincingly into the real-world images (of course the lighting must also be set up correctly in
Cinema 4D).
几乎每个3D 艺术家的一个共同任务是将渲染的对象合成为真实世界的场景-静态或动画。这样做的一个主要问题是创建真实世界材质的未知摄像机角度——特别是透视和焦距。这些设置也必须反映在Cinema 4d 摄像机,用于渲染3D 物体。只有这些设置相匹配,3D 物体才能令人信服地组合成真实世界的图像(当然,照明也必须在Cinema 4D 设置正确)。
Using the Camera Calibrator tag you can load a photo/image (referred to in the
following as, reference image’) and interactively reconstruct the camera’s focal length, orientation and
position.
使用 Camera calibator 标签,你可以加载一张照片/图像(参考图像如下所示) ,并交互式地重建相机的焦距、方向和位置。
Tip:
提示:
In addition to the objects, the calibrated camera and the light setup in the scene above there is also a Plane
used as a floor (for shadow and reflection) and a Background object onto which - in both cases - the
reference image is projected using camera mapping.
除了对象,校准相机和光设置在上面的场景还有一个平面用作地板(阴影和反射)和一个背景对象,在这两种情况下,参考图像投影使用相机映射
For the reconstruction, Cinema 4D needs 2 vanishing points and 2 separate, vertically stacked planes. To
define vanishing points, parallel lines must be drawn on the image (when displayed in a perspective view,
these lines will create a vanishing point):
为了重建,C4D院需要2个消失点和2个独立的垂直堆叠平面。要定义消失点,必须在图像上绘制平行线(当在透视图中显示时,这些线将创建一个消失点) :
Parallel lines culminate in an imaginary vanishing
point. 平行线在一个假想的消失点中达到顶点
This works best when working with images of buildings, city squares or similar elements in which clear,
parallel lines that lie perpendicular to each other exist.
这种方法在处理建筑物、城市广场或类似元素的图像时效果最好,在这些图像中,彼此垂直的清晰的平行线条存在。
If you should determine that straight lines are actually depicted bent (extreme example: fisheye look), it’s
most likely due to the fact that the recording camera has a lens distortion applied to it. If the distortion
is too strong (either very pronounced or the camera calibration is faulty), you have to create a lens profile
using the Lens Distortion tool and load it into this tag.
如果你确定画的直线实际上是弯曲的(极端的例子: 鱼眼镜头) ,这很可能是因为录制相机有一个镜头失真应用到它。如果失真太强烈(不管是非常明显或摄像机校准是错误的) ,你必须创建一个镜头配置文件使用镜头失真工具,并加载到这个标签。
Tip:
提示:
This tag assumes control of the corresponding camera settings (coordinates, focal length, etc.). For a camera
that has been completely calibrated, these settings can no longer be modified and the focal length cannot be
changed.
此标记假定控制相应的相机设置(坐标、焦距等)。对于一个已经完全校准的相机,这些设置不能再修改,焦距也不能改变
Interactive Control
交互式控制
If the Camera Calibrator tag is selected, the following key combinations will be
made available:
如果选择了 Camera calibator 标签,将提供以下组合键:
-
Shift 转移
+ Ctrl 1. Ctrl + left click:
Moves the reference image 左击: 移动参考图像
-
Shift 转移
+ Ctrl 1. Ctrl + right click: Scales the reference image + 右击: 缩放参考图片
-
Shift 转移
+ repeated clicking on a line or grid side runs through the different axes: X
(red), Y (green), Z (blue), no selection (gray) + 重复点击一条直线或网格边沿不同轴线运行: x (红色) ,y (绿色) ,z (蓝色) ,无选择(灰色)
-
Ctrl 1. Ctrl
+
moving a line or grid will duplicate these 移动一条线或者一个网格会重复这些
-
Shift 转移
+
moving a Pin removes the locking on a line or grid vertex 移动引脚可以移除线或网格顶点上的锁定
Example of how a camera can be calibrated based on a photo
基于照片的摄像机矫正示例
- Create a camera and assign it a 创建一个相机,并为它分配一个Camera Calibrator 摄像机矫正 tag. Activate the camera in
the Perspective view. 在透视视图中激活相机
- In the 在Image 图片 tab, load the image whose camera
setting is to be recreated into the tag’s 选项卡中,加载要重新创建摄像机设置的图像到标签中Image 图片 field. The image will be displayed in the Viewport (you can, for example,
simply make a screenshot of the image shown below from the documentation and use this image for this
example). 字段。图像将显示在 Viewport 中(例如,您可以简单地从文档中截取下面显示的图像的屏幕,并在本例中使用此图像)
- Locate parallel lines or edges in the image that lie perpendicular to each other. 在图像中找到彼此垂直的平行线或边缘
In the image above, lines parallel to the Z axis are marked with blue arrows and lines parallel to the X axis
are marked with red arrows. At least 2 lines from each axis will have to be marked in the following step.
在上图中,平行于 z 轴的线用蓝色箭头标记,平行于 x 轴的线用红色箭头标记。在下面的步骤中,每个轴上至少有2行需要标记。
- In the 在Camera Calibrator 摄像机矫正 tag’s 标签Calibrate 校准 tab,
click on the 选项卡,点击Add Line 添加行 button. Click and drag on the ends of the line and place
them on a corresponding X axis line in the image. 按钮。单击并拖动线的两端,将它们放置在图像中相应的 x 轴线上
Shift
+click on the line until it turns red (X axis).
Shift + 单击该行,直到它变成红色(x 轴)。
- Click on 点击Add Line 添加行 again (or copy the first line by 再次(或复制第一行Shift 转移+click+dragging it) and position the line on the line that runs horizontally
below it on the floor (2). + 点击 + 拖动它) ,并定位该行的水平运行低于它在地板上(2)Shift 转移+click on this line until it turns red
(X axis). The vanishing point for the X plane has now been defined and the state of the + 点击这一行直到它变成红色(x 轴)。现在已经定义了 x 平面的消失点和 x 平面的状态X Vanishing Point 消失点 setting will change to 设置将改为Solved 解决了.
- Proceed in a similar fashion for the Z axis lines. Add 2 new
lines and place them on the floor (3) and along the wall (4). 以类似的方式处理 z 轴线。添加2条新线,并将其放置在地板(3)和沿墙壁(4)Shift 转移+click on each line until it turns blue, which will assign them to the Z axis.
This completes the definition of the vanishing points and the focal length and camera angle can be calculated.
The corresponding parameters will be colored yellow and green in the Camera Calibrator’s tab. + 单击每一行直到它变成蓝色,这将把它们分配到 z 轴。这样就完成了消失点的定义,并且可以计算出焦距和相机角度。相应的参数将在 Camera Calibrator 的标签页中显示为黄色和绿色
- Except
for the exact camera orientation itself, all pertinent camera settings have been defined. To define the
camera’s orientation, add a new line and position it in the rear corner (5) and make it a green (Y)
axis. 除了精确的相机方向本身,所有相关的相机设置已经定义。要定义相机的方向,添加一条新线,并将其放置在相机的后角(5) ,并使其成为绿色(y)轴
- Click on 点击Add Pin 添加引脚. In the Viewport, drag the Pin onto an end of one
of the Y axis lines. .在 Viewport,将大头针拖到 y 轴线的一端
- Click on the Y axis line, which will select both the line and the Pin. Enable the
单击 y 轴线,它将同时选择线条和引脚Known Length Y 已知长度 y option and enter a value of 选项并输入值178
cm 178厘米 (the squash serve line lies 1.78 m above the floor. Done. (壁球发球线离地面1.78米,完成
Tip:
提示:
You can now click on the 你现在可以点击Create Background Object 创建背景对象 button to create a Background
object including the texture. You can then render an object in front of the image as a background. For more
complex compositions, for example if an animated object should disappear behind another object in the image,
a dummy object must be modeled onto which the images is projected from the camera’s angle of view (see also
按钮来创建一个包含纹理的背景对象。然后您可以渲染图像前面的一个对象作为背景。对于更复杂的组合,例如,如果一个动画物体隐藏在图像中的另一个物体后面,则必须模拟一个虚拟物体,该虚拟物体的图像从相机的视角投射到该物体上(另见Projecting the reference image for rendering 为渲染投影参考图像).
Now all pertinent camera settings have been clearly defined. As a test you can create a Cube object and move it
along the axes. You will see that the cube follows the lines according to the image’s perspective.
现在所有相关的相机设置已经明确定义。作为测试,您可以创建一个 Cube 对象并沿着轴移动它。您将看到,根据图像的透视图,立方体遵循直线。
General info and tips
一般信息和提示
- Keep an eye on the color fields in the 中的颜色域Calibrate 校准 tab. They offer a good
feedback regarding your calibration. Generally speaking, the more green the better. 标签。他们对你的校准提供了很好的反馈。一般来说,越环保越好
- When using images
in which the camera should move along a street, a corridor or a tunnel, or view a building head-on, lines for
all three vanishing points should be added, if possible. 当使用图像时,摄像机应该沿着街道、走廊或隧道移动,或者正视建筑物时,如果可能的话,应该为所有三个消失点增加线条
- When using a Material tag projected by the
camera ( 当使用由相机投射的 Material 标记时(Create Camera Mapping Tag 创建相机映射标签 button), the camera view to be rendered should
also be set along with the camera used. 按钮) ,相机视图渲染也应该设置随着相机使用
- If you scale or move the reference image using the 方法缩放或移动参考图像Image 图片 tab’s settings (or the corresponding hotkeys) for better calibration, don’t
forget to set it back to 标签的设置(或相应的热键)为更好的校准,不要忘记设置回来100 using the 使用Full
Image 完整图片 button. Otherwise the camera will only be calibrated for that particular view, which is not the
desired result. 按钮。否则,相机将只校准该特定的视图,这不是理想的结果
Limitations of the vanishing point method
灭点法的局限性
- If no vanishing points can be calculated, this method cannot be used. This would be the case, for example,
if an image contains only (perspective) lines that run vertically. This is, however, rarely the case. It is
therefore important to precisely define lines/grids along vanishing lines. Outdoor images or images depicting
nature scenes can also be difficult to define without the presence of right angles. In such an event you’d
have to draw by eye and make an approximate placement of the lines on the, floor’. 如果无法计算消失点,则不能使用此方法。例如,如果一个图像只包含垂直运行的(透视)线,就会出现这种情况。然而,这种情况很少发生。因此,重要的是沿着消失线精确地定义线/网格。如果没有直角的存在,描绘自然场景的户外图片或图像也很难定义。在这种情况下,你必须用眼睛来画,并在地板上大致画出线条的位置
- The aspect ratio
( 长宽比(Film Aspect 电影方面) of the recording camera must be known unless the pixels are not
square. This is the case for most cameras but not necessarily for still images that were taken from videos.
Note also that the aspect ratio of images created using anamorphic lenses (they compress the image
horizontally) must be adjusted to the uncompressed value (e.g., how it is viewed on a television screen) using
the ) ,除非像素不是正方形,否则必须知道摄影机的位置。这是大多数相机的情况,但不一定是从视频中拍摄的静态图像。另请注意,使用变形镜头(水平压缩图像)制作的图像的长宽比必须调整至未压缩值(例如,在电视屏幕上如何观看)Image 图片 tab’s setting. 标签设置好了
Tilt-shift lenses are not be supported. 倾斜镜头不支持