PTGUI官网英文原版“视点校正”教程

[复制链接]
查看11579 | 回复6 | 2012-11-19 15:13:44 | 显示全部楼层 |阅读模式

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

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

x
One of the more advanced features in PTGui Pro is viewpoint correction. Viewpoint correction allows one to use different camera viewpoints in the same panorama, provided that the relevant part of the images is approximately flat. It is particularly useful when including a handheld nadir image in a panorama taken from a tripod. 6 u+ @% ]* R' Y- L2 s) ^

3 O: o( m; s6 w3 iViewpoint correction is included in PTGui Pro only; the regular version of PTGui does not include this feature.
/ p+ j1 C# |7 f, lParallaxWhen photographing panoramas, rule number one is to shoot all images from exactly the same viewpoint. More specifically the camera should be rotated around the 'no parallax point' (the optical center of the camera/lens). Otherwise, parallax errors will occur. The following images show an example of parallax: % w& t/ z' V$ ~+ [! X  o

& Q" L( d( b) |% E7 q* l parallax1.jpg     parallax2.jpg % y. d( z' M1 I- }$ f  t7 L# _

; T$ ?4 R% Z' @* x- R# U. i/ ?These photos were taken from two different camera positions. As a result the buildings in the background have moved relative to the position of the buildings in the foreground. While this may be an extreme example, in practise even camera movements of only a few centimeters may result in visible parallax if there are nearby objects in the scene.
. W, F1 H( v! Z& k
; B5 K1 |% c6 j% OIt's not difficult to see that parallax is a problem when stitching photographs: a stitcher can either align the objects in the foreground or the objects in the background, but not both at the same time. Even worse: the optimizer will get severely confused, unable to determine the camera and lens properties, causing misalignments in other areas of the panorama as well. Unlike other artefacts like barrel distortion, correcting for parallax errors is impossible; the best one can do is attempting to mask the misalignments by retouching the stitched panorama afterwards.
7 g( ?3 ^4 E! k* K# U+ q5 @
8 B, U7 A% B+ _* _6 e' y) }( S$ VSo it should be clear that in order to avoid parallax, it is important to take all images from the same viewpoint. But there is one exception:
2 u! N( C0 P# KPerspective correction of flat imagesWhen the photographed subject is completely flat, we can correct the viewing perspective by stretching the image in a specific way. In Photoshop for example the Free Transform function can be used. This is shown in the following example: / D, m  h- ?* K

  z: f) S, ?: \, x) J3 d4 F billboard1.jpg     billboard2.jpg ) ^$ l' B- P- J$ ]2 {
0 o+ y. T- b% M* J' v" [
The first image shows the original photograph of a billboard, taken from the side. The second image is extracted from the first and transformed into a rectangular shape. The second image looks identical to a photo taken from a point in front of the billboard. So by transforming the image we have 'virtually' moved the camera position from the side of the billboard to in front of the billboard.
5 p' U. H9 w8 k4 y
9 M+ Z8 _, o. HBut this only works if the photographed subject is flat. If we would apply the same transformation to a larger part of the image, anything in front or behind the billboard surface would become severely stretched:
) p: J$ @( E7 O' o, d
, a. ~; T2 y1 i, ^, b( `- f1 ^$ m billboard3.jpg , k! z4 U/ ?$ G. v
; ~* o0 X0 M, }
Although a panorama rarely consist of just a flat surface, this technique is still useful for panoramas. When photographing a spherical panorama, taking the nadir image (with the camera facing downwards) can be a challenge: in order to hide the tripod from the panorama, the photographer has to move the tripod away and shoot the nadir image hand held. It's nearly impossible to hold the camera at exactly the same viewpoint as the other images. Furthermore, the down facing image will inevitably include the photographer's feet, which have to be masked away. And finally, on a sunny day it is unavoidable to have the camera's (and the photographer's) shadow somewhere in the panorama.
% }. I& ?, ^% j# \% Y0 X2 p# t& f. |9 @/ _9 b; U/ \" f
Since many panoramas actually have a flat surface in the nadir (like a level street, or the floor in a room), these problems can be overcome by not having the camera in the same viewpoint when shooting the nadir image, and using the technique explained above to correct for the camera position offset. This is exactly what the viewpoint correction function in PTGui Pro does. / |0 r" R8 q* |! c$ a; Y
Viewpoint correction in PTGui ProViewpoint correction is controlled by two groups of parameters: the Image Parameters tab (visible in Advanced mode) contains five parameters, labeled 'VP ...'. Further, the Optimizer tab (in Advanced Optimizer mode) has a checkbox labeled 'Viewpoint' for each image. By checking the checkbox, the optimizer will optimize the five 'VP ...' parameters, based on the given control points. The VP parameters perform a translation in 3 axes and a rotation along 2 axes. It's not necessary to understand their meaning since the values are determined by the optimizer.
! e( C! W! `: D& L  x" H) m+ ]) X; m0 O) E
Since viewpoint correction only works on flat surfaces, any image which is viewpoint corrected must only have control points placed on a single flat surface. So when used in the nadir image, that image should have control points only on the floor. Therefore control points must be placed by hand; the control point generator in PTGui cannot tell whether a certain point is on the floor or not. The best results are achieved when using many control points (at least 10 is recommended), spread across the surface. With too few control points, or too closely spaced control points, the optimizer may get stuck, unable to determine the viewpoint. ! v# @# Q4 s5 T+ O# g6 n
ExampleWe have the following four images (Raffles Quay, Singapore):
+ L* C. G- i  e. c0 K9 c' ~7 Q6 q1 o
IMG_2619.jpg    IMG_2620.jpg    IMG_2621.jpg    IMG_2622.jpg   - P4 t0 V0 \( b5 z# Y# S. A

. K, g, I2 e' ~2 D& ^" m& [# |Download example images and project files (10 MB Zip file) 5 v6 `7 M6 R( p7 j/ f$ h
1 p7 W" ^# L+ A& e/ y* h2 S* r; \
Start PTGui, add the four images (img_2619.jpg to img_2622.jpg) to a new project and press Align Images. PTGui analyzes the images, adds control points and aligns the images. This results in the following preview (step1.pts): 9 i7 [7 U9 t6 Q  P0 w; k
( F3 B; g' J, e8 ?- {& X6 S/ U
step1.jpg $ e2 k: j% v2 v0 m

$ [; c/ B) J3 u4 A/ ZIn this example the alignment of the images can be improved a little more by editing control points: remove the control points which PTGui placed on (moving) clouds. Also we add a few extra control points at the top of the skyscrapers and on the tiles of the floor, to get a more even distribution of the control points across the entire image area. Choosing 'Minimize lens distortion: Heavy + Lens Shift' on the Optimizer page will give a better correction of lens distortion and compensate for the slight offset of the cropping circle to the actual image circle. Press F5 to optimize. This results in an average control point distance of 0.85, which is very good (step2.pts). : R1 z( ]0 y, [3 P) P* [/ R

1 \' r6 M$ k/ }4 X! @Since the camera was tilted slightly upwards the zenith is covered but the nadir is not. A nadir shot was taken to cover this hole: 9 B$ e% {! Q/ D% i& j2 B' |0 K; U6 m- |

" i6 E0 ?& n) Y% n5 N- w6 O+ S nadir.jpg
1 u: N9 `8 B% u) ~; o  e5 a
0 F; l0 Z2 Q6 C1 [To demonstrate the effects of parallax this nadir shot was deliberately taken with a large viewpoint offset: the camera was moved at least a meter from the original shooting position. The camera was at a different height as well, and tilted towards the point on the floor below the original shooting position.
0 P4 \) e3 i4 e8 g3 x& d8 Q+ \. e# F0 V. `& b7 v+ L# k
Add the nadir shot to the project by dragging it (nadir.jpg) into the PTGui window. As explained above, we need to add control points for the nadir image by hand, and all control points in the nadir image must be on the ground surface: 9 C5 ]6 \1 {: B) i

8 d  K2 O- \) F cps_floor.jpg
- o, P+ L( Y; ~: z; ?; L9 a. F" K6 E: K7 n* t: t  a/ `- w
Do this for all 4 images (step3.pts). 8 |. m; \4 H2 B0 `1 ~8 D

, ?2 [1 Q7 X; Y& A8 YIf we try to optimize the project (by pressing F5), the result is very bad (step4.pts): 7 O; k" k+ _2 G# I# C7 ^+ ~

, N6 n- \% g1 u' {. z. L badopt.gif 0 C0 J  J+ `3 v, k5 w, D

7 K% U  A* H' QThe misalignment is of course caused by the camera offset of the nadir image, which the traditional image alignment model in PTGui cannot cope with. But let's enable the viewpoint correction:
5 V. Q* @, Y- j" a$ ^6 L  V4 I) Z9 ?/ ^0 a* P( z
Switch the Optimizer to Advanced mode by pressing the Advanced button on the Optimizer tab. First we optimize the project without the control points of the nadir image. This enables PTGui to determine the proper lens parameters, without being distracted by the viewpoint offset in the nadir image. We do this by unchecking 'use control points of image 4' (step5.pts): 8 J7 j. h/ I* ]$ T3 F' V5 W4 k- X/ h
! b* o; {! h2 _8 ^& I: M
opt1.jpg
" N& S1 z0 ^9 ]! P( |
( C2 G" @9 B; V0 d; |: T) YPress F5 to run the optimizer; the result should again be 'very good', and the first 4 images are actually aligned the same as they were before the nadir image was added. 9 ]- |: X0 O( l5 P7 N+ l, s

  n  j9 e1 n8 W: k* `8 A8 x( @) MNow enable the control points of image 4 again, and enable the Viewpoint optimization for image 4 (step6.pts):
6 s4 {1 |) Z$ Y' G: r* `6 d) V5 ]7 P% a
opt2.jpg & b6 J# \9 J* |. {( X5 u6 P! E
* O6 b& B0 b0 {/ t9 I0 r
Again press F5 to run the optimizer. Note that the result is now 'very good', even with the nadir image included in the optimization. And this is what the alignment looks like in the panorama editor:
& \  J5 K1 A; B+ c6 U$ v4 ?7 v% |8 F% t0 l4 u8 A, b4 i1 V' B
goodopt.gif
, L1 m5 q! J% x# V7 u+ ?% ?3 ~" ^' N7 m; z3 H6 ], v
As we see the alignment on ground level is nearly perfect, despite the viewpoint offset. Note that anything above or below ground level is misaligned, such as the black cubes at the river side. Indeed, the viewpoint correction only works for a single flat surface; objects below or above the surface will suffer from parallax.   U4 ?4 T) f5 E

3 U. x4 c: z% _( w3 f) W' KView the resulting panorama interactively (requires Flash 9).
  a# _5 l/ C  V! k/ F$ S, t3 j9 s; u+ [+ g5 k' E# W4 u. @
There's still one problem in the generated panorama: the blender has used part of the nadir images at the black cubes, which are not at ground level:
6 c  \( y4 ?& \: {! [5 R( O7 v
+ m6 M# p5 D5 ~) f0 X! ^, B8 V cubes.jpg
' X! T' ]2 `: ^) ?1 M! t" i; B3 P5 S/ [: |6 M$ v
This is easily solved using the 'Blend priority' parameter. Go to the Image Parameters tab and reduce the blend priority of the nadir image from 100 to 25 (step7.pts). This causes the blender to use only the central part of the nadir image (plus a bit of additional overlap). See the online help for the Image Parameters tab in PTGui Pro for more information.
' S! m( @( R/ }( `5 x& ^7 z. }2 g
The result is a perfect nadir:
# ~4 ]7 D9 J( Y2 R3 |! K
! B/ Z9 ~) b3 s1 g$ L8 T1 V/ FView the resulting panorama interactively (requires Flash 9).
/ i: @8 I" t# K! p  ?7 h& mTroubleshootingIt'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: , E6 l* b: e9 G7 Z! Z
    7 z5 D5 t/ F6 I/ O

    # I9 B. i) F  ?9 F! V  o" z1 t
    . A, I( u, G/ s3 x! J. W7 ^
  • 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.+ t, Q. f& x  K" M' S
If the optimizer still reports a bad result, try the following:
) g9 G( `7 {* J% D$ {- u! K

      p. u; _1 Y, ^4 h" h; w  X/ e' }+ X) y$ ]' P+ d5 y1 ?! O
    2 s) ^3 W9 `1 w1 P* M$ U
  • 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.3 E; T6 ~% J1 s& V; P  m$ X9 p
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. % }/ O8 w5 A: \# U7 J# _& P

( v" K' j7 D* |4 f8 G, @+ K7 b这么好的教程,看不懂,怎么办,该怎么办才好,各位前辈能否帮忙翻译了,或者提供些类似的教程,很想了解这方面的知识。
虚若 | 2012-11-19 17:47:45 | 显示全部楼层
看不懂
birdman | 2012-11-21 23:20:24 | 显示全部楼层
拿着字典学习!
东郭先生 | 2012-11-23 08:41:07 | 显示全部楼层
要是有人能翻译下就好了
tangkunlin | 2017-4-10 21:06:35 | 显示全部楼层
又是英文,看不懂啊,老大!!!
向上倾斜45度 | 2017-5-9 16:20:18 | 显示全部楼层
百度翻译不靠谱啊,跪求中文版的:'(
鱼眼龙 | 2017-5-14 11:21:16 | 显示全部楼层
向上倾斜45度 发表于 2017-5-9 04:20 PM
. R' C& h# e7 L$ u. W百度翻译不靠谱啊,跪求中文版的

* o1 C6 ~, Y  z+ c要看中文版的,请移步 https://chinavr.net/t/11290/1/1/ F, D6 x  R4 V+ R

$ B" N  ~" y) `9 H我自己根据实战经验,也写了一个简易的教程,尽量简化的一个简易教程:https://chinavr.net/t/11245/1/1
) M& a% P8 B! ]2 s: j& ^1 F% z7 h
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则