Академический Документы
Профессиональный Документы
Культура Документы
Pi19404
February 6, 2013
Contents
Contents
OpenCL Image Convolution-Seperable Filters 3
0.1 Abstract . . . . . . . . . . . . . . . . . . . . . 0.2 Separable Filters . . . . . . . . . . . . . . . 0.3 Computation Required for Convolution kernel . . . . . . . . . . . . . . . . . . . . . . 0.4 Parallel Implementation . . . . . . . . . . . 0.5 Comparison with CPU implementations . 0.6 Code . . . . . . . . . . . . . . . . . . . . . . . References . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . Using Separable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3 3 4 4 5 5 6
2 | 6
3 | 6
+ Q)
Q Thus 2D convolution requires computation by a factor PP+Q larger than separable convolution method.
For a
3x3
1:5.
4 | 6
OpenCL Image Convolution-Seperable Filters ie we are storing the results in the transposed matrix. Then performing the row convolution again with the resultant matrix is equivalent to performing column filtering and again storing the result in the transposed matrix. This way we have coalesced memory read ,adjacent threads in a thread block are accessing adjacent global memory locations. Each thread will perform computations of all the three dimensions of the pixels in the present implementations. In the present implementations local memory is not used.But in the later article we will implement a local memory implementations where the data from the global memory is copied to the local memory and computations are performed on a block of data by each thread block and results are combined to obtain the desired row/column filtering operations.
0.6 Code
The code consits of two parts the host code and the device code. Host side code uses OpenCv APIs to read the image from video file and demonstrates the calling of the kernel code for Box filter for 2d convolution,seprable filter and host CPU implementation. Code is available in repository https://code.google.com/p/m19404/ source/browse/OpenCL-Image-Processing/Convolution/
5 | 6
Bibliography
Bibliography
[1] [2] [3] [4] [5] [6] [7]
uic.edu/kreda/gpu/image-convolution/. html.
Image Convolution Filter.
url: http://www.evl.
html.
//www.dspguide.com/ch24/3.htm.
url: http :
6 | 6