Transcript Experimental results
Electrical Engineering Department of National Cheng Kung University
期末Demo報告
Cross-based
2012/08/13
指導教授:詹寶珠教授 報告者:王邦威
Smart Media & Intelligent Living Excellence Lab.
1
Electrical Engineering Department of National Cheng Kung University
Flow chart Method Implement on GPU Experimental results
Outline
Smart Media & Intelligent Living Excellence Lab.
2
left
Smart Media & Intelligent Living Excellence Lab.
Electrical Engineering Department of National Cheng Kung University
Introduction
right
3
Electrical Engineering Department of National Cheng Kung University
Local base algorithm
L R y P(Lx,Ly) Disparity= Lx-Rx
Smart Media & Intelligent Living Excellence Lab.
P’(Rx,Ry) 4
Electrical Engineering Department of National Cheng Kung University
Flow chart
Support region construction Matching cost Cost aggregation Winner-take-all
Smart Media & Intelligent Living Excellence Lab.
Post-processing 5
Electrical Engineering Department of National Cheng Kung University
Cross-based local support region construction
Two constraints • L • d • 2
Smart Media & Intelligent Living Excellence Lab.
6
左圖
Electrical Engineering Department of National Cheng Kung University
右圖
Locally adaptive matching cost aggregation
Matching cost • • C AD : Ccensus : Hamming distance of the two strings that stand for p and pd R. Zabih and J. Woodfill , “Non-parametric local transforms for computing visual correspondence,” in
Proc. ECCV, 1994,
pp. 151 –158.
String 2 7
Smart Media & Intelligent Living Excellence Lab.
Electrical Engineering Department of National Cheng Kung University
Locally adaptive matching cost aggregation
Cost aggregation • d Winner-take-all • f
Smart Media & Intelligent Living Excellence Lab.
8
Electrical Engineering Department of National Cheng Kung University
Left/right consistency check
We apply occlusion treatment via left/right consistency checking to check the condition .
Then we fill in the disparity for invalidated pixels. For an invalidated pixel , we search its closest valid pixel to the left and to the right.
Smart Media & Intelligent Living Excellence Lab.
9
Electrical Engineering Department of National Cheng Kung University
Implement on GPU
整合 CUDA 和 Open CV • 建一個專案,將含有 cuda 的程式碼部分包成一個 Dll 檔 • 對主函式和含有 Open CV 的程式碼另外建一個專案,寫在 Cpp 檔 • 在利用到 GPU 就呼叫 Dll 檔 Host Device CPP 檔 ( 主程式且包含 呼叫 Open CV 程式片段 ) DLL 檔 ( 包含呼叫 GPU 程式片段 ) GPU (kernel function)
Smart Media & Intelligent Living Excellence Lab.
10
Electrical Engineering Department of National Cheng Kung University
Implement on GPU
Number of threads : width Number of blocks : height Width One block Height
Smart Media & Intelligent Living Excellence Lab.
11
Electrical Engineering Department of National Cheng Kung University
Experimental results
384x288 執行時間 :0.058
秒
Smart Media & Intelligent Living Excellence Lab.
12
Electrical Engineering Department of National Cheng Kung University
Experimental results
時間分析
-AD
原程式 • 計算 matching cost 和水平區域 cost 總和 :0.625
秒 • • • • 長區域所花時間 :2.67
秒 計算垂直上每點的水平 cost 總合和 WTA:0.561
秒 後處理 :0.017
秒 總共 :3.941
秒 平行化的程式 • 計算 matching cost 和水平區域 cost 總和 :0.022
秒 • • • • 長區域所花時間 :0.012
秒 計算垂直上每點的水平 cost 總合和 WTA:0.022
秒 後處理 :0.002
秒 總共 :0.058
秒 加速 68 倍
Smart Media & Intelligent Living Excellence Lab.
13
Electrical Engineering Department of National Cheng Kung University
Experimental results
384x288 執行時間 :0.273
秒
Smart Media & Intelligent Living Excellence Lab.
14
Electrical Engineering Department of National Cheng Kung University
Experimental results
時間分析
-AD&Census
原程式 • 計算 Census cost:1.646
秒 • • • • • 加總水平區域的 cost:0.406
秒 長區域 : 2.67
秒 計算垂直上每點的水平 cost 總合和 WTA:0.561
秒 後處理 :0.017
秒 總共 :5.684
秒 平行化的程式 • 計算 Census cost:0.21
秒 • • • • • 加總水平區域的 cost:0.026
秒 長區域 :0.012
秒 計算垂直上每點的水平 cost 總合和 WTA:0.025
秒 後處理 :0.002
秒 總共 :0.273
秒 加速 20 倍
Smart Media & Intelligent Living Excellence Lab.
15
Electrical Engineering Department of National Cheng Kung University
Conclusions
對於擁有許多不相依性計算的方法,可以很容易達到 不錯的加速效能 適當的利用 share memory ,可以達到更快的速度
Smart Media & Intelligent Living Excellence Lab.
16
Electrical Engineering Department of National Cheng Kung University
Thank for your attention!
Smart Media & Intelligent Living Excellence Lab.
17