期末 demo 報告 cross-based

17
Electrical Engineering Department of National Cheng Kung University Smart Media & Intelligent Living Excellence Lab. 1 2012/08/13 指指指指 指指指指指 指指指 指指指 指指 Demo 指指 Cross-based

Upload: fleur

Post on 05-Jan-2016

73 views

Category:

Documents


9 download

DESCRIPTION

期末 Demo 報告 Cross-based. 2012/08/13 指導教授:詹寶珠教授 報告者:王邦威. Outline. Flow chart Method Implement on GPU Experimental results. Introduction. left. right. Local base algorithm. L. R. y. P(Lx,Ly). P’( Rx,Ry ). Disparity= Lx-Rx. Flow chart. Support region construction. Matching cost. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: 期末 Demo 報告 Cross-based

Electrical Engineering Department of National Cheng Kung University

1Smart Media & Intelligent Living Excellence Lab.

2012/08/13指導教授:詹寶珠教授

報告者:王邦威

期末 Demo 報告 Cross-based

Page 2: 期末 Demo 報告 Cross-based

Electrical Engineering Department of National Cheng Kung University

Smart Media & Intelligent Living Excellence Lab. 2

Outline

Flow chart

Method

Implement on GPU

Experimental results

Page 3: 期末 Demo 報告 Cross-based

Electrical Engineering Department of National Cheng Kung University

Smart Media & Intelligent Living Excellence Lab. 3

Introduction

left right

Page 4: 期末 Demo 報告 Cross-based

Electrical Engineering Department of National Cheng Kung University

Smart Media & Intelligent Living Excellence Lab. 4

Local base algorithm

L R

Disparity= Lx-Rx

y

P(Lx,Ly) P’(Rx,Ry)

Page 5: 期末 Demo 報告 Cross-based

Electrical Engineering Department of National Cheng Kung University

Smart Media & Intelligent Living Excellence Lab. 5

Flow chart

Support region construction

Matching cost

Cost aggregation

Winner-take-all

Post-processing

Page 6: 期末 Demo 報告 Cross-based

Electrical Engineering Department of National Cheng Kung University

Smart Media & Intelligent Living Excellence Lab.

Cross-based local support region construction

Two constraints• L

• d

• 2

6

Page 7: 期末 Demo 報告 Cross-based

Electrical Engineering Department of National Cheng Kung University

Smart Media & Intelligent Living Excellence Lab.

Locally adaptive matching cost aggregation

Matching cost

• CAD :• Ccensus : Hamming distance of the two strings that stand

for p and pd

7

String

R. Zabih and J. Woodfill, “Non-parametric local transforms for computing visual correspondence,” in Proc. ECCV, 1994, pp. 151–158.

2

左圖 右圖

Page 8: 期末 Demo 報告 Cross-based

Electrical Engineering Department of National Cheng Kung University

Smart Media & Intelligent Living Excellence Lab. 8

Locally adaptive matching cost aggregation

Cost aggregation• d

Winner-take-all• f

Page 9: 期末 Demo 報告 Cross-based

Electrical Engineering Department of National Cheng Kung University

Smart Media & Intelligent Living Excellence Lab. 9

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.

Page 10: 期末 Demo 報告 Cross-based

Electrical Engineering Department of National Cheng Kung University

Smart Media & Intelligent Living Excellence Lab. 10

Implement on GPU

整合 CUDA和 Open CV• 建一個專案,將含有 cuda的程式碼部分包成一個 Dll檔• 對主函式和含有 Open CV的程式碼另外建一個專案,寫在

Cpp檔• 在利用到 GPU就呼叫 Dll檔

CPP檔(主程式且包含呼叫 Open CV程式片段 )

DLL檔(包含呼叫

GPU程式片段 )

GPU(kernel

function)

Host Device

Page 11: 期末 Demo 報告 Cross-based

Electrical Engineering Department of National Cheng Kung University

Smart Media & Intelligent Living Excellence Lab. 11

Implement on GPU

Number of threads : width

Number of blocks : height

One block

Width

Height

Page 12: 期末 Demo 報告 Cross-based

Electrical Engineering Department of National Cheng Kung University

Smart Media & Intelligent Living Excellence Lab. 12

Experimental results

384x288

執行時間 :0.058秒

Page 13: 期末 Demo 報告 Cross-based

Electrical Engineering Department of National Cheng Kung University

Smart Media & Intelligent Living Excellence Lab. 13

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倍

Page 14: 期末 Demo 報告 Cross-based

Electrical Engineering Department of National Cheng Kung University

Smart Media & Intelligent Living Excellence Lab. 14

Experimental results

384x288

執行時間 :0.273秒

Page 15: 期末 Demo 報告 Cross-based

Electrical Engineering Department of National Cheng Kung University

Smart Media & Intelligent Living Excellence Lab. 15

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倍

Page 16: 期末 Demo 報告 Cross-based

Electrical Engineering Department of National Cheng Kung University

Smart Media & Intelligent Living Excellence Lab. 16

Conclusions

對於擁有許多不相依性計算的方法,可以很容易達到不錯的加速效能

適當的利用 share memory,可以達到更快的速度

Page 17: 期末 Demo 報告 Cross-based

Electrical Engineering Department of National Cheng Kung University

Smart Media & Intelligent Living Excellence Lab. 17

Thank for your attention!