PTGUI“视点校正”教程详解

[复制链接]
查看34934 | 回复10 | 2017-6-21 08:59:32 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
PTGui有两个版本:PTGui和PTGui Pro。两者的最大区别是,后者有HDR高动态拼接、遮罩、视点矫正、暗角矫正、曝光矫正、白平衡矫正。本帖只隆重介绍对于全景补地帮助最大的“视点矫正”功能。
; M3 m# @1 A+ U4 s6 h7 |  U; }1 I9 G0 m" K7 ^( j
最直接、最简单一句话介绍的话,视点矫正,就是补地拍摄的照片,可以脱离该机位原有的镜头节点(视点)位置进行拍摄,然后在PTGUI软件里将视点的偏移矫正回来。
1 ]6 ?4 H6 F2 `+ e  f7 V# q. T& T7 e: z& t2 z4 |: L
最重要的一句话要记住:视点矫正,仅对于二维平面景物有效!!!) L+ H3 ]: E% _8 N; j! P, ^
* j' l4 C$ }( T( Z+ v' W7 Q
+ R* _% W: t+ c; o8 a
PTGui Pro的“视点矫正”功能详解(官网正文节选)2 N! V6 x1 m. B8 g$ F: y
李景超翻译并编辑
; g* `2 Y2 L& J- W; g: {2 b
) P( z: _0 W! \, \; O# G* S8 i# o, T6 X; X) x0 D" m& u9 Z
由于“视点矫正”只对二维平面景物有效,所以,当要用到补地的图片时,这张图片应该只在地面上有控制点。如果软件在地面以外的地方加了控制点,则必须手动删除,并在地面需要的地方手动添加控制点。PTGui的“自动对齐”功能,不能判断某控制点是否在地面上。用较多分散的控制点(推荐至少10个)可以达到最好的效果,而控制点数量太少,或者控制点的分布太靠近了,都可能引起优化引擎的误判。3 M* d8 j. _/ s( J

. K0 Y) t9 [8 x
由于“视点矫正”只对二维平面景物有效,所以,当要用到补地的图片时,这张图片应该只在地面上有控制点。如果软件在地面以外的地方加了控制点,则必须手动删除,并在地面需要的地方手动添加控制点。PTGui的“自动对齐”功能,不能判断某控制点是否在地面上。用较多分散的控制点(推荐至少10个)可以达到最好的效果,而控制点数量太少,或者控制点的分布太靠近了,都可能引起优化引擎的误判。
/ T- H. ]! K7 ~. _3 A4 J: z
示例:
以新加坡摄影师Raffles Quay的四张原始底片为例:
5244b5fdc6d2dd962a5602b6279af58e.png
这里可以下载:http://www.ptgui.com/images/vptut/viewpointcorrection.zip

* G) U; W+ p0 f& H  d7 y# }: ^
启动PTGui,添加这4张图片(img_2619.jpg ~ img_2622.jpg),点击对齐图像(Align ImagesPTGui将分析这些图像,并自动添加控制点。
下边是结果(步骤一):
0d9c1a50433ffd6731c32d9ff774e423.png
8 P1 @" c, M/ p7 Q9 _

- Y. O- p% n- N: O
例中,图像对齐的情况,可以通过编辑控制点进行修改。比如,删除PTGui自动设置在移动的白云上面控制点。另外,我们也可以大楼上和地砖上手工额外增加一些控制点,以得到更加分散到整个图像区域的控制点。在“优化”选项卡中,选择“最小的镜头畸变Minimize lens distortion: Heavy+Lens Shift)”,可以得到很好的畸变矫正和少量圆形裁剪图像位移补偿。然后,按F5进行优化,可得到控制点平均距离为0.85的结果,效果非常好(步骤二)

' a8 L# ]9 C9 M9 f1 r+ w; L. O
但是由于全景拍摄时,镜头稍上仰,导致上图在拼接后地面有一个黑洞,因此,要进行补地拍摄,作为修补黑洞的“补丁”:
3fc15266e94d22c642f969829f2b4894.png
2 T) D7 t8 S0 Y

4 Q, ~* v- g. i1 b, y0 Q) G5 e' E
为了更好地演示PTGUI“视点矫正”功能之强大,补地的照片故意在较大的的视点位移下拍摄:相机被移到了距原机位至少1米的位置,相机高度也与原来不同。相机向原来的拍摄点下方的地面倾斜拍摄。这就是我们在论坛里经常提到的“斜拍补地”。
* T% r5 ^0 a' t, ~. E: S, X
拖动那张补地图片(nadir.jpg)到PTGui窗口,添加到该项目中。然后按照如上所述,为补地图片手动添加控制点,并且所有控制点都必须在地面上。
a748965595ee363c77c757a70749b8b6.png
使补地的一张图片分别与前面所有4张图片之间都有控制点(步骤三)
; j7 K  L! p. _4 @$ R4 l$ \2 H

1 t9 @8 X/ G% c2 p6 s" b
如果我们试着优化这个工程(按F5键),得到的结果非常糟糕“very bad”(步骤四):
6 G+ G) L4 ?+ k+ C
没有对齐的原因是补拍地面图片时相机有位移,这是PTGui传统图片对齐模式不能奏效的。但是我们使用视点矫正方式,如下:
在优化选项卡下按下高级按钮切换到高级优化模式。首先我们在地面图片没有控制点的情况下优化工程,没有视点位移的影响,让PTGui自己决定正确的滤镜参数。我们可以取消选择“use control points of image 4”(步骤五)
e655c9c030281de5a7f56890125e2ee8.png
6 p* Z, A8 d- {
     F5键运行优化程序;结果应该再一次是“Very Good”,前4张图片会和没有添加地面图片之前一样真正对齐。
     现在再次让image 4的控制点起作用,同时为image 4启动视点优化程序(步骤六)
656f47c98987cb15ce5109d439a977ac.png
! O; E0 M$ Z7 U( M0 x% y
1 B3 T, E* W. X% {: s8 Z
) @6 i$ h8 n# K( R
3 h& [8 D, b' @  C$ r
     再次按下F5键运行优化程序。注意到即使地面图片也优化的情况下结果是“Very good”。下边是在“panorama editor”窗口中看到的对齐情况:

: M2 Q& q6 l5 q! O0 I6 @4 o. z" b

- Y, V+ l6 k7 w
2 L9 k' V9 y* Y

# Y3 L$ u/ Z4 u4 }* }" }) Z6 I' G
如我们看到的那样,尽管有视点的位移,地面这层的对齐效果几近完美。注意到不管是地面这层以上还是以下都没有对齐,比如那个黑色的方块就没有在地面层上:
cd2417bea36203a18d28edd5965111c8.png
- V; B& p" K( C  U& h6 [1 X: R

, t3 }  x: \+ Q
这点很容易通过调整“Blend priority”参数解决。到“Image Parameters”选项卡中,减小地面图片的融合优先级,从100调整到25(步骤七)。这会是图片融合器仅仅使用地面图片中央的那部分(还加上一点额外的重叠)。参见PTGui“Image Parameters”选项卡的在线帮助得到更多信息。

& }" Z- w. f3 {  S; n% Z; Y
得到完美的地面效果:
http://www.ptgui.com/examples/BoatQuay/
5 l1 y) X9 N% G+ U' b
3 M1 k2 k0 b' C2 U3 R2 W$ I3 S
答疑:
在本地最小化状态下运行优化引擎时,得到“Very bad”的结果时有发生。原因是补地图片尚有大量的参数需要优化,而这些参数之间很多是互相关联的。你可以提供一个合理的开始点,来帮助优化引擎,具体步骤如下:
1、在“图片参数”选项卡中,将所有的VP值设置为0
2、在“优化”选项卡中,屏蔽所有图片的视点矫正选项,选择所有图片“use control point of:”,运行优化。这会得到很糟的优化结果,但是可将补地图片放到适当的位置;
3、暂时取消补地图片的“use control points of”选项,不选视点矫正,运行优化。这次应该得到“Good”的结果,设置正确的镜头参数;
4、至此,优化引擎应该有了一个有效的起始点。复选地面图片的“use control points of:”和视点矫正选项,再次运行优化。

, d6 A+ x" v2 j- H, H
如果优化引擎仍然报告“bad”的结果,按下边的步骤试一下:
1、设置补地图片的“pitch”-90“yaw”0。重置补地图片的5个VP参数到0
2、在优化选项卡中,屏蔽地面图片的yawpitch的优化选项,打开视点矫正,打开所有图片的“use control points of:”选项;
3、运行优化程序;
4、如果优化引擎报告“good”“not bad”,优化引擎可能找到了补地图片的正确位置。现在打开补地图片的yawpitch优化选项,再次运行优化程序。
( |" x" k$ G% ]
如仍不见效,请重新检查补地图片的控制点,确认没有错点。注意,仅仅一错点就可能导致错误的结果。
( O5 R* w* b0 [4 E; Z6 n# k2 {

$ ~; m" e" S6 G* _  d
  O1 j' B- _9 J6 V% H+ `
db6242dc1cef49cb4c57ca392da0ce5c.png
duxian | 2018-3-27 07:56:02 | 显示全部楼层
clock918 | 2018-12-24 11:31:29 | 显示全部楼层
答疑部分和翻译版有出入  基本看不懂
鱼眼龙 | 2019-1-3 18:57:59 | 显示全部楼层
clock918 发表于 2018-12-24 11:31 AM) F  t4 I5 ]% S; j
答疑部分和翻译版有出入  基本看不懂
# |0 _4 g0 E/ Y9 A6 P2 v
答疑部分的原文如下,仅供参考:: M' ^) L+ l; b8 Q( `" ]. ]

7 P6 S2 ?3 h3 T7 R: d! zTroubleshooting
2 M9 ~) _2 X2 h% f* `/ _It's possible that the optimizer gets stuck in a local minimum when trying to optimize the viewpoint, resulting in a 'very bad' optimization result. The optimization is less stable than normal due to the large number of parameters to be optimized for the nadir image, and the fact that there is a lot of dependency between those parameters. You can help the optimizer by providing a reasonable starting point. This can be done as follows:
2 k' X- F* d$ Y
  • In the Image Parameters tab set all VP values to zero.
  • Optimizer: disable Viewpoint optimization for all images, enable 'use control points of:' for all images and optimize. This will give a bad optimization result (similar to the bad result shown above), but brings the nadir image into the appropriate orientation.
  • Uncheck 'use control points of:' for the nadir image, leave Viewpoint optimization disabled and optimize again. This should give a good result, and set the lens parameters to the correct values.
  • Now the optimizer should have a good starting point. Enable 'use control points of:' for the nadir image, enable Viewpoint optimization for the nadir image, and optimize again.5 Z0 Z) E8 B$ R# j1 j  |
If the optimizer still reports a bad result, try the following:0 @1 g3 U) J# h# p
  • Set the pitch of the nadir image to -90, and the yaw to 0. Reset the 5 viewpoint parameters of the nadir image to 0.
  • On the Optimizer tab, disable the optimization of yaw and pitch of the nadir image and enable viewpoint optimization of the nadir image. Enable 'use control points of:' for all images.
  • Run the optimizer
  • If the optimizer reports a good or 'not bad' result, it has probably found the right position of the nadir image. Now enable yaw and pitch optimization for the nadir image and run the optimizer again./ |; g3 g, [9 R6 H" h8 f# r
If this still doesn't help, review the control points of the nadir image and make sure you didn't accidentally misplace one. A single faulty point is enough to break the optimization. Adding a few more control points, spaced across the entire nadir surface (don't forget to place control points on distant features on the nadir surface), may further help the optimizer in finding the VP parameters. Sometimes a little trial and error is necessary, by removing some control points and adding others. After each modification, start from step 1 mentioned above, until the optimizer reports a good result.
! l( p0 e6 Z4 v% V. q, kTry it!
jichiniao | 2020-7-22 20:15:38 | 显示全部楼层
鱼眼龙 | 2021-7-27 17:56:01 | 显示全部楼层
注意:PTGUI 11版12版已经不使用“视点矫正”(viewpoint correction)这个词了。
$ K4 l8 X$ s$ `% F, r8 s7 Q$ ~最新版PTGUI 里改用“优化”(optimize)。  S3 o3 q5 s9 R6 r& ?
duxian | 2021-11-7 08:26:21 | 显示全部楼层
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

图文推荐
热门排行