• 沒有找到結果。

DLS與SDLS的演算法複雜度分析

6、 實驗數據及結果

6.5. DLS與SDLS的演算法複雜度分析

主要計算量為 r 個 dot-product,r 為 Diagonal Matrix 的非零項個數,最大可能值為 Joints 的總個數 J,因此複雜度為 O(J)個 dot-product。

一個 dot-product。O(1)。

因此 DLS 的總複雜度為 O(J*k)個乘法與加法。

個數 k 個取 Norm,複雜度 O(J*k)個 3 個乘法和 2 個加法。

在 For Loop 中的所有步驟計算複雜度為 O(k*k+3*J*k+J)個乘法和 O(k*k+2*J*k+J+k) 個加法;化簡為 O(k2+J*k)個乘法和 O(k2+J*k)個加法。

我的實驗中 k=12,J=21

DLS:252 個乘法與 252 個加法 SDLS:4752 個乘法與 4752 個加法 我的實驗量測:

求 J&SVD 求取Δθ One-iteration total DLS method 70 sμ 70~80 sμ 140~150 sμ

SDLS method 70 sμ 1800~1900 sμ 1850~2000 sμ 演算法分析中 SDLS 比 DLS 求取Δθ 要多做約 18.85 倍的計算;

實際 runtime 中 SDLS 比 DLS 求取Δθ 要多費時約 22.5 倍;

顯示分析結果為一個可接受的範圍。

因此我們可知道 SDLS 每個單一 iteration 要比 DLS 耗時得多,因此如果用 DLS 與 SDLS 所需的 iteration 次數差不多時,其實 SDLS 反而耗時,此時可以選擇 DLS 來取代之。

6.6. 以不同的

λ

值,觀察

Δθ

的收斂情形,以選擇比較好的

λ

iteration 次數=42

λ =0.7

iteration 次數=12

Rshoulder-x-dof 各 iteration 的Δθ 圖 λ =1.1

iteration 次數=16

Rshoulder-x-dof 各 iteration 的Δθ 圖

λ =1.6

iteration 次數=32

Rshoulder-x-dof 各 iteration 的Δθ 圖 λ =2.1

iteration 次數=51

λ =3.1

iteration 次數=116

Rshoulder-x-dof 各 iteration 的Δθ 圖

六種不同的λ 各 iteration 的 θΔ 的比較圖

六種不同的λ 各 iteration 的 θΔ 的比較放大圖 結論:

λ 過大或過小都會造成所需 iteration 次數的上升,

由圖中我們看出λ 過小時會造成 θΔ 過大,每次 Update 的Δθ 過大,造成後來要修正前 面 Update 錯誤的Δθ 的誤差,造成收斂較久。

由圖中我們看出λ 過大時會造成 θΔ 過小,每次 Update 的Δθ 過小,造成一次就可以 Update 的Δθ 卻分成了很多次去 Update,造成收斂較久。

根據我實驗的資料顯示λ 值在 0.7~1.1 所得的結果較為良好。

6.7. 比較 IK 做每個 frame 與 key-frame 內插的結果

在一連串的動作經過 IK 修正後,可以透過一些演算方式判斷某些 frame 的動作是 key-frame。如下列的動作序列中,我們研判 frame#0 與 frame#12 是此動作序列中的 key-frame,因此我們將 frame#0 與 frame#12 中各個 DOF 的角度都進行線性的內插,等 分成為與原本的 frame 數相同的數量;使內插出來的 frame 能與原本 IK 修出來的 frame 一一對應。並觀察是否兩個序列會很相似,如此即可以僅記錄 key-frame 的部份為代表,

而不需記錄每一個 frame 的結果了。

實驗結果如下:

View1、View2 分別是同一時刻不同角度的影像

IK 是 IK 針對每一個 frame 的影像修正完所得到的結果

Interpolation 則是以 frame#0 與 frame#12 為 key-frame 內插出來的結果

View 1 View2 IK interpolation

0

1

2

3

4

5

6

7

8

9

10

11

12

IK 結果 內插結果

data_index No.0 Lheel x-rot -0.628871 Lheel y-rot 0.414916 Lheel z-rot 1.98725 Lknee -rot 8.76062 Lhip x-rot -9.99215 Lhip y-rot 6.94059 Lhip z-rot 3.91477 Navel -rot -9.83073 Neck -rot -22.2485 Lshouder x-rot 42.931

data_index No.0 Lheel x-rot -0.628871 Lheel y-rot 0.414916 Lheel z-rot 1.98725 Lknee -rot 8.76062 Lhip x-rot -9.99215 Lhip y-rot 6.94059 Lhip z-rot 3.91477 Navel -rot -9.83073 Neck -rot -22.2485 Lshouder x-rot 42.931

Lshouder y-rot 24.3061 Lshouder z-rot -1.51413 Lelbow -rot 7.06775 Rshouder x-rot 18.9633 Rshouder y-rot 3.01439 Rshouder z-rot 1.15472 Relbow -rot 1.96698 Lshouder x-rot 39.3187 Lshouder y-rot 10.0836 Lshouder z-rot 3.51785 Lelbow -rot 15.3832 Rshouder x-rot 19.988 Rshouder y-rot 13.7141 Rshouder z-rot 6.08119 Relbow -rot 2.02559 Rhip x-rot 5.60785 Rhip y-rot -1.14143 Rhip z-rot -1.19435 Rknee -rot -0.0998361

Lshouder y-rot 24.3061 Lshouder z-rot -1.51413 Lelbow -rot 7.06775 Rshouder x-rot 18.9633 Rshouder y-rot 3.01439 Rshouder z-rot 1.15472 Relbow -rot 1.96698 Lshouder x-rot 50.2478 Lshouder y-rot 24.2355 Lshouder z-rot -0.776488 Lelbow -rot 6.48223 Rshouder x-rot 24.7771 Rshouder y-rot 4.37107 Rshouder z-rot 2.34314 Relbow -rot 2.33066 Rhip x-rot 10.64 Rhip y-rot 0.81055 Rhip z-rot -7.37621 Rknee -rot -0.514337

data_index No.12 Lshouder x-rot 130.733 Lshouder y-rot 23.4589 Lshouder z-rot 7.33757 Lelbow -rot 0.0415155 Rshouder x-rot 88.7284 Rshouder y-rot 19.2945 Rshouder z-rot 15.4158 Relbow -rot 6.33115 Lshouder x-rot 130.733 Lshouder y-rot 23.4589 Lshouder z-rot 7.33757 Lelbow -rot 0.0415155 Rshouder x-rot 88.7284 Rshouder y-rot 19.2945 Rshouder z-rot 15.4158 Relbow -rot 6.33115

frame#1 t θ

Δ :4.2035° Standard deviation ofΔθt :3.8447°

frame#2 t

θ

Δ :3.8272° Standard deviation ofΔθt :4.0658°

frame#3 t

θ

Δ :3.7009° Standard deviation ofΔθt :3.1201°

frame#4 t

θ

Δ :3.7620° Standard deviation ofΔθt :3.8868°

frame#5 t

θ

Δ :4.8400° Standard deviation ofΔθt :4.9597°

frame#6 t

θ

Δ :5.4187° Standard deviation ofΔθt :5.6126°

frame#7 t

Δθ :5.7384° Standard deviation ofΔθt :6.5933°

frame#8 t

θ

Δ :3.7321° Standard deviation ofΔθt :3.2390°

frame#9 t

θ

Δ :3.6835° Standard deviation ofΔθt :2.8643°

frame#10 t

θ

Δ :3.0816° Standard deviation ofΔθt :3.2287°

frame#11 t

Δθ :3.2236° Standard deviation ofΔθt :3.1543°

各 frame t 的 Δθt

並統計所有 frame 平均的Δθt 與其標準差。

θ Δ =

= T Δ

t t

1

θ ,T 為總 frame 數。

Standard deviation ofΔ =θ

=

Δ

T Δ

t

t

T 1

)2

1 ( θ θ

求出在此組實驗數據中,

所有的 frame 平均的一個 joint 的角度差異Δ :4.1101° θ Standard deviation ofΔ :0.8226° θ

結論:

實驗結果果然如預期,內插出來的 frame 確實極為相似,不僅在圖形上極為相近,

在 local 角度上的差異也極小;各 DOF 的平均角度差異僅約 4°。因此我們確實可以僅記 錄 key-frame 的 local 角度資訊來代替所有的 frame 的 local 角度資訊。

7、 結論和未來工作

7.1. 結論

本論文使用兩部攝影機所拍攝到的立體影像序列,重建了人體關節點粗略的 3D 位 置,並相信人體的 End-Effectors 是在影像處理方法中能夠取得較準確的點,其三維位置 座標能夠重建的比較精確,相對地其他的內部關節點較不準,因此選擇以 End-Effectors 中的關節點做為 Root,並且因為人體至少會以一腳著地,因而使用腳跟做為人體模型的 Root。

並因為相信人體的 End-Effectors 的三維座標位置是較為精確的,故強調使用逆向動 力學修正內部錯誤的關節角度。與原拍攝圖片對照後,確實能夠將表演者的動作重現於 程式中的 3D 人體模型。使得本論文在內部的關節點座標品質較差的情況下,能夠成功 地使用立體視覺人體動作原始資料,進行修正的程序。

論文實驗中更比較了是否使用 IP 資訊引導逆向動力學之間的差異,不同的逆向動 力學演算法之間的不同,演算法複雜度的分析,以及以 key-frame 代替完整影像序列的 實驗結果。

實驗的最後結論是,以 IP 資訊引導,並使用 Damped Least Square 逆向動力學,是 在效率上與正確性上較好的選擇。

7.2. 未來工作

本論文純粹是考慮在立體影像序列中人體關節點的自動截取已經完成的情況下進 行修正,因此影像中人體關節點截取的好壞會影響到以 IP 為初解時,這個初解的好壞,

如此也會連帶影響以逆向動力學修正後的正確性,因此改進立體影像序列中人體關節點 的自動截取將是使本論文的應用更提升的一個重要工作。

若以後想以肚臍為 Root 並再增加腳尖(toe)以及肚臍與頸部的轉動自由度,則可依據圖 7-1 擴充的左手定則人體肢節樹狀模型圖去實施。圖中若肚臍對 x 軸旋轉時,身體則可 左右擺動;若肚臍對 y 軸旋轉時,肩膀則可上下擺動;若肚臍對 z 軸旋轉時,身體則可 上下擺動。

圖 7-1 擴充的左手定則人體肢節樹狀模型圖

在關節的角度限制上,我們僅以各轉軸的轉動上下限來約束人體模型的運動。若能 夠再加入自我碰撞的偵測,就能夠使這個人體模型的 Constraint 更加地完整。

本論文的人體模型是一個樹狀架構的表示,內部的關節點個數與 End-effectors 個數 都沒有限制,因此這個模型只要經過適當地設定其關節點與 End-effectors 就可以套用到 任何的動物上,如馬、狗等等,若再針對不同的動物設定正確的 Constraint,就可以將 本論文應用到任何的動物上了。

由於人體各肢節的長度因人而異,本論文採取人為量測被拍攝者身體肢節長度的方 式,若能夠自動化這個項目,本論文的系統就能更加自動化。

參考文獻

1. Grigore Burdea, and Philppe Coiffect, "Virtual Reality Technology",John Wiley & Sons, New Yourk N.Y. 1994

2. Joe Gradecki, "The Virtual Reality Construction Kit", John Wiley & Sons, New York N.Y. 1994

3. Frederick H. Raab, Ernest B. Blood, Terry O. Steiner, and Herbert R. Jones, "Magnetic Position and Orientation Tacking System", IEEE Transcations on Aerospace and Electronic System, vol. AeS-15, no.5, pp.709-717. September 1979

4. Jih-fang Wang, Vernon Chi and Henry Fuchs, "A Real-time Optical 3D Tracker For Head-mounted Display System", Proc. Of IEEE Virtual Reality Annual International Symposium, Seattle, W.A., September 1993.

5. Jun Rekimoto, "A Vision-Based Head Tracker for Fish Tank Virtual Reality-VR without Head Gear", Proc. of 1995 IEEE Virtual Reality Annual International Symposium, Research Triangle Park, N.C., pp.94-100, March 1995.

6. 周宏隆, ”虛擬實境中以真人帶領木偶做肢體動作之電腦視覺技術”, 國立交通大學,

碩士論文, 民國 85 年

7. Samuel R. Buss and Jin-Su Kim, “Selectively Damped Least Squares for Inverse Kinematics”, ACM Journal of Graphics Tools, 2004.

8. 吳政峰, “人體肢節三維動作捕捉之電腦視覺技術”, 國立交通大學, 碩士論文, 民國 93 年

9. Naoto Date, Hiromasa Yoshimoto, Daisaku Arita and Rin-ichiro Taniguchi,

“Real-timeHumanMotion Sensing based on Vision-based Inverse Kinematics for Interactive Applications”, IEEE ICPR ’04, Jan 2004.

10. 謝寧, ”融入與互動式虛擬棒球遊戲中真人揮棒打擊”, 國立交通大學, 碩士論文, 民 國 86 年

11. Q. Cai, A. Mitiche, and J. Aggarwal, “Tracking human motion in an indoor environment”, Proc. of International Conference on Image Processing, vol A, 1995, pp.215-218.

12. J. Aloimonos, “Perspective approximation”, Image and Vision Computing, vol. 8, no.3, pp.179-192, 1990

13. Li-Chun Tommy Wang and Chih Cheng Chen, “A Combined Optimization Methods for Solving the Inverse Kinematics Problem of Mechanical Manipulators”, IEEE

Transactions on Robotics and Automation, Vol. 7, NO. 4, August 1991

14. A.Sezgin Abalı, “ANIMATION OF HUMAN OTION WITH INVERSE KINEMATICS USING NONLINEAR PROGRAMMING”, b_ilkent university, master thesis,

September, 2001

15. Chris Welman, “INVERSE KINEMATICS AND GEOMETRIC CONSTRAINTS FOR

September 1993

16. JIANMIN ZHAO and NORMAN 1. BADLER, “Inverse Kinematics Positioning Using Nonlinear Programming for Highly Articulated Figures”, University of Pennsylvania, ACM Transactions on Graphics, Vol. 13, No.4, October1994, Pages313 336

17. Naganand Madhavapeddy and Stuart Ferguson, “Specialized Constraints for an Inverse Kinematics Animation System Applied to Articulated Figures”, The Queen’s University of Belfast

18. E. Durucan and T. Ebrahimi, “Change Detection and Background Extraction by Linear Algebra,” Proceedings of the IEEE, Vol.89, No.10, pp.1368-1381, Oct. 2001.

19. T. Aach, et al., “Statistical model-based change detection in moving video,” Signal Processing, Vol.31, pp.165-180, 1993.

20. Elgammal,A., Harwood,D. and Davis L. “Non-parametric Model for Background Subtraction”, Proc IEEE FRAME-RATE Workshop,

21. Rafael C. Gonzalez & Richard E. Woods “Digital Image Processing”

22. 張家銘, “三維動畫中動作重置之研究”, 國立清華大學, 碩士論文, 民國 90 年 23. 黃聿文, ”三維空間多攝影機視覺監控系統”, 國立交通大學, 碩士論文, 民國91年 24. 謝耀賢, ”環場全景製作技術及其在虛擬實境應用”, 國立交通大學,碩士論文,民國

86 年

25. 張振宇, ”利用人臉視覺資訊作為虛擬實境畫面瀏覽之控制”, 國立交通大學, 碩士 論文, 民國 88 年

26. 陳郁中, “藉由平面投射轉換執行影像嵌合及物体重建”, 國立交通大學, 碩士文, 民 國 89 年

相關文件