25
Narrow Band Level set on GPU Chunliang Wang CMIV, Linköping University

Narrow Band Level set on GPU - computer-graphics.se · Presentation1.pptx Author: chuwa Created Date: 6/3/2010 9:04:06 AM

  • Upload
    others

  • View
    0

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Narrow Band Level set on GPU - computer-graphics.se · Presentation1.pptx Author: chuwa Created Date: 6/3/2010 9:04:06 AM

Narrow Band Level set on GPU Chunliang Wang

CMIV, Linköping University

Page 2: Narrow Band Level set on GPU - computer-graphics.se · Presentation1.pptx Author: chuwa Created Date: 6/3/2010 9:04:06 AM

Image Segmetation

Page 3: Narrow Band Level set on GPU - computer-graphics.se · Presentation1.pptx Author: chuwa Created Date: 6/3/2010 9:04:06 AM

Contour based Segmentation

V(s)=[xi,yi]T

Page 4: Narrow Band Level set on GPU - computer-graphics.se · Presentation1.pptx Author: chuwa Created Date: 6/3/2010 9:04:06 AM

Internal Force - Curvature

Page 5: Narrow Band Level set on GPU - computer-graphics.se · Presentation1.pptx Author: chuwa Created Date: 6/3/2010 9:04:06 AM

External Force-Intensity

Page 6: Narrow Band Level set on GPU - computer-graphics.se · Presentation1.pptx Author: chuwa Created Date: 6/3/2010 9:04:06 AM

Explicit Contour

Page 7: Narrow Band Level set on GPU - computer-graphics.se · Presentation1.pptx Author: chuwa Created Date: 6/3/2010 9:04:06 AM

Implicit Contour: Level-set

[1]S. Osher and R.P. Fedkiw, Level set methods and dynamic implicit surfaces, Springer, 2003.  

Page 8: Narrow Band Level set on GPU - computer-graphics.se · Presentation1.pptx Author: chuwa Created Date: 6/3/2010 9:04:06 AM

Explicit Contour->Level Set

[1]S. Osher and R.P. Fedkiw, Level set methods and dynamic implicit surfaces, Springer, 2003.  

Page 9: Narrow Band Level set on GPU - computer-graphics.se · Presentation1.pptx Author: chuwa Created Date: 6/3/2010 9:04:06 AM

Level set in Physics

Page 10: Narrow Band Level set on GPU - computer-graphics.se · Presentation1.pptx Author: chuwa Created Date: 6/3/2010 9:04:06 AM

Level set For Image segmenation

Page 11: Narrow Band Level set on GPU - computer-graphics.se · Presentation1.pptx Author: chuwa Created Date: 6/3/2010 9:04:06 AM

What is done in each iteration

  Calculate external speed (intensity)

  Calculate internal speed (curvature)

  Calculate local gradient

  Calculate the local step length (sum of speeds*gradient* dt)

  Add the step length to the level set function

Page 12: Narrow Band Level set on GPU - computer-graphics.se · Presentation1.pptx Author: chuwa Created Date: 6/3/2010 9:04:06 AM

GPU implementation

http://code.google.com/p/cudaseg/

Page 13: Narrow Band Level set on GPU - computer-graphics.se · Presentation1.pptx Author: chuwa Created Date: 6/3/2010 9:04:06 AM

GPU shared mem vs. CPU   Test image 512*512 (30 time faster)

Page 14: Narrow Band Level set on GPU - computer-graphics.se · Presentation1.pptx Author: chuwa Created Date: 6/3/2010 9:04:06 AM

Narrow Band level set

26s on CPU

[1]D. Adalsteinsson, D. Adalsteinsson, J.A. Sethian, and J.A. Sethian, “A Fast Level Set Method for Propagating Interfaces,” JOURNAL OF COMPUTATIONAL PHYSICS, vol. 118, 1994, pp. 269--277.  

Page 15: Narrow Band Level set on GPU - computer-graphics.se · Presentation1.pptx Author: chuwa Created Date: 6/3/2010 9:04:06 AM

Drawbacks of Narrow band on GPU

  No shared memory

  No coalescing

  List operation

Page 16: Narrow Band Level set on GPU - computer-graphics.se · Presentation1.pptx Author: chuwa Created Date: 6/3/2010 9:04:06 AM

Generating Active Points list using CUDPP on GPU

http://cudpp.googlecode.com/svn/trunk/cudpp/doc/CUDPP_slides.pdf

Page 17: Narrow Band Level set on GPU - computer-graphics.se · Presentation1.pptx Author: chuwa Created Date: 6/3/2010 9:04:06 AM

GPU vs. CPU

0 5 10 15 20 25 30

1

2

narrow band

narrow band

Page 18: Narrow Band Level set on GPU - computer-graphics.se · Presentation1.pptx Author: chuwa Created Date: 6/3/2010 9:04:06 AM

Ultra-Narrow Band Sparse field level set

13 s on CPU

[1]R.T. Whitaker, “A level-set approach to 3d reconstruction from range data,” INTERNATIONAL JOURNAL OF COMPUTER VISION, vol. 29, 1998, pp. 203--231.  

Page 19: Narrow Band Level set on GPU - computer-graphics.se · Presentation1.pptx Author: chuwa Created Date: 6/3/2010 9:04:06 AM

Generate list from list index1 index2 index3 index4 index5

neigbor1 neigbor1 neigbor1 neigbor1 neigbor1

neigbor2 neigbor2 neigbor2 neigbor2 neigbor2

Index2’s neighbor

Index1’s neighbor

index2 Index2’s neighbor

Index1’s neighbor

index1 Index2’s neighbor

Index1’s neighbor

Page 20: Narrow Band Level set on GPU - computer-graphics.se · Presentation1.pptx Author: chuwa Created Date: 6/3/2010 9:04:06 AM

Lazy narrow band levelset

0.8 s on CPU

[1]M. Roberts, J. Packer, M.C. Sousa, and J.R. Mitchell, “A Work-Efficient GPU Algorithm for Level Set Segmentation.”  

Page 21: Narrow Band Level set on GPU - computer-graphics.se · Presentation1.pptx Author: chuwa Created Date: 6/3/2010 9:04:06 AM

GPU vs. CPU

0 2 4 6 8 10 12 14

1

2

sparse field

sparse field

Page 22: Narrow Band Level set on GPU - computer-graphics.se · Presentation1.pptx Author: chuwa Created Date: 6/3/2010 9:04:06 AM

Lazy narrow band levelset

0.8 s on CPU

[1]M. Roberts, J. Packer, M.C. Sousa, and J.R. Mitchell, “A Work-Efficient GPU Algorithm for Level Set Segmentation.”  

Page 23: Narrow Band Level set on GPU - computer-graphics.se · Presentation1.pptx Author: chuwa Created Date: 6/3/2010 9:04:06 AM

Summary

0 200 400 600 800 1000 1200 1400

original

narrow band

sparse field

lazy sparse field

cpu

gpu

0 10 20 30

narrow band

sparse field

lazy sparse field

CPU

GPU

Page 24: Narrow Band Level set on GPU - computer-graphics.se · Presentation1.pptx Author: chuwa Created Date: 6/3/2010 9:04:06 AM

On 3D   256*256*256 dataset

gpu cpu

original 360 -

sparse field 70 450

lazy sparse field 141 90

1. I haven’t be able to make my 3D version works on GPU, the 14s record is from Roberts’ paper. [1]M. Roberts, J. Packer, M.C. Sousa, and J.R. Mitchell, “A Work-Efficient GPU Algorithm for Level Set Segmentation.”  

Page 25: Narrow Band Level set on GPU - computer-graphics.se · Presentation1.pptx Author: chuwa Created Date: 6/3/2010 9:04:06 AM

Thank You!