GitXplorerGitXplorer
S

pic_filtering

public
2 stars
0 forks
0 issues

Commits

List of commits on branch master.
Unverified
91564cc57cd4978448b910cd744df6747382a397

Remove extra variable in filter sobel_filter function

SSam-Serpoosh committed 11 years ago
Unverified
607548c47364b5c9fcb72e6b739b79caae85ab31

Add timing for the filter application

SSam-Serpoosh committed 11 years ago
Unverified
3c0533a960ed801c9d9ee372037d713f6514ae69

Extract header file for sobel

SSam-Serpoosh committed 11 years ago
Unverified
10799cd7ffc30c478ac8cda2eaab18ca6fdaa760

Add the cuda version as well for running on GPU

SSam-Serpoosh committed 11 years ago
Unverified
d6dad7d08c6785395d24d73b0c3dbdc1881070d3

Extract 1d & 2d conversions to read_write_bmp code

SSam-Serpoosh committed 11 years ago
Unverified
bb6b648acdc088cdf8e96409e0eb021182917d32

Convert 2d array to 1d array for filtering

SSam-Serpoosh committed 11 years ago

README

The README file for this repository.

Soble Filter on Images

Goals

Implementing Sobel edge detection algorithm on CPU completely. And also implementing the filtering part of the Sobel algorithm for running on GPU using CUDA. Some performance comparison between completely-on-CPU and partially-on-GPU versions! Why the result is what it is etc.

The result of the filtering and edge detection using Sobel algorithm for some sample images is as following:

Cell image before filtering

Cell Image Filtered

SestonDiatom before filtering

SestonDiatom Filtered

Chryseobacterium Filtered

Chryseobacterium Filtered (somewhat inverted version of previous image)

As you can see we magnified the edges of the above images which is the goal of Sobel Algorithm!

Performance and Execution Time measurements

The execution time for the CPU and GPU versions of implementation in milliseconds are as following:

|    CPU     |    GPU      |        Image         |
|  0.021799  |  0.395673   |       Cell.bmp       |
|  0.073794  |  0.357644   | Chryseobacterium.bmp |
|  0.002312  |  0.341441   |   OnionTelphase.bmp  |
|  0.01477   |  0.344096   |   SestonDiatom.bmp   |

As you can see the execution time for the partially-on-GPU version of the implementation is considerably slower in all the cases! There are couple of reasons for that! In this timing the effect of overhead for data transfer back and forth between host and device has not eliminated from the final execution time value and because of that it's not completely accurate to say GPU version is WAY slower! But even without the overhead of data transfer the GPU version is not faster than the CPU version and the reason is the intensity of the computation we're dealing with and size of images!

For images with this size-range and an algorithm such as Sobel which is not very intense (computation-wise) the GPU and all its added complexity and messiness (for the code) won't bring us benefits!

All in all, it was a very intereesting experience and fun to mess with some CUDA programming and its ideas and concepts behind it! And of course there are tons of applications that can benefit from the power of GPUs for intense computations (lots of bioinformatics applications are running on GPUs etc.)