220 likes | 391 Views
Object Oriented Framework for CUDA based Image Processing. Pritam Prakash Shete , Venkat P. P. K., Dinesh M. Sarode , Mohini Laghate , S. K. Bose & R. S. Mundada , Bhabha Atomic Research Centre, Mumbai, India .
E N D
Object Oriented Framework for CUDA based Image Processing PritamPrakashShete, Venkat P. P. K., Dinesh M. Sarode, MohiniLaghate, S. K. Bose & R. S. Mundada, BhabhaAtomic Research Centre, Mumbai, India International Conference on Communication, Information & Computing Technology (ICCICT) Oct. 19-20,2012, Mumbai, India • Keywords: Object oriented framework, CUDA,design patterns, image processing 組員名單: P76004588徐華煊 P76004423 曾郁凱 P76014216 吳品頡
1. Introduction • Compute Unified Device Architecture (CUDA) • CUDA is a novel and promising GPU programming frame work from NVIDIA. • The CUDA has been speedup many computationally intensive graphics as well as nongraphic • Essential for a seamless panoramic mosaic • A pyramidal image blending algorithm • Our goal • To show that use of design patterns facilitate extending existing functionality by adding new classes, rather than modifying an existing classes or functionality
2. Analysis and Design- LaplacianPyramid doubles for the next octave σ=2*1.6 σ=1.6 High frequency σ=k4*1.6 σ=k3*1.6 σ=k2*1.6 k = 2(1/s) s: Image per octave s = 3 in this case σ=k*1.6 σ=1.6 σ=k-1*1.6 D(σ) DoG filter Gaussian filter L(σ)
3. Implementation - Modules • Image Blending Library (IBL): They developed framework for CUDA based image processing. • This frame work offers 3 modules for an image processing: • CPU Module • Simple-CUDA Module • IO-CUDA Module
3. Implementation - Modules • CPU Module • Using single thread • Implementation function: • Gaussian blur • Laplacian pyramid • REDUCE operation • EXPAND operation
3. Implementation - Modules • Simple-CUDA Module CPU CPU Memory Return image Send image GPU Global Memory Process Image
3. Implementation - Modules • IO-CUDA Module Image already get GPU Global Memory Send image Return image Shared Memory Process Image
3. Implementation - Automatic Image Conversion • Visitor Design pattern • Image type: CPUBuffer image and CUDABuffer image Output: CUDABuffer Concrete Element Concrete Visitor Visitor Element Concrete Visitor Concrete Element Output: CPUBuffer
3. Implementation - Image Source Integration • General Hierarchy Pattern
3. Implementation - Extensible Architecture • Construction of Gaussian & Laplacian Pyramid
3. Implementation - Extensible Architecture • Building the Gaussian pyramid • Non modifiable code along with placeholders for extending it • Using Factory Method patternplaceholders • Creating the image buffer • Gaussian blur • REDUCE operation • Realized by the respective subclasses • Ex. CPUBlendingFactory • Ex. IOCUDABlendingFactory
3. Implementation - Extensible Architecture • Combine Pyramid Operation
3. Implementation - Extensible Architecture • Combine Pyramid Operation • Validating an input pyramids • Allocating memory for an output pyramid • Combining high pass and low pass images • The Template Method pattern is used to define the skeleton • Combining high pass images and low pass image are placeholder or extension points • Subclasses redefinecombining high pass and low pass images without changing basic algorithm structure • Ex. CPUCombinePyramidOperation • Ex. IOCUDACombinePyramidOperation
4. Result • Specification • Intel Core 2 Duo with E8400 3.00 GHz processor • 2GB RAM • NVIDIA’s Quadro FX 4600 • Input images covers low resolution (128x128) as well as a high resolution (2048x2048)
4. Result • Panoramic image stitching
4. Result • CUDA based modules perform much better than the CPU module • Simple-CUDA • Device global memory • IO-CUDA module • Fast on-chip shared memory
5. Conclusion • Implemented an object oriented framework for a GPU based image processing • Using software engineering principles and design patterns • Extending the framework for computation using the GPU memory