GithubHelp home page GithubHelp logo

kimwoonggon / cuda-dilation-and-erosion-filters Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mompes/cuda-dilation-and-erosion-filters

0.0 0.0 0.0 156 KB

A CUDA implementation of the dilation and erosion filters showing several optimizations to speed up the processing.

License: GNU General Public License v2.0

C++ 22.20% C 1.69% Cuda 74.45% Makefile 1.66%

cuda-dilation-and-erosion-filters's Introduction

Dilation and Erosion filters in CUDA

Several implementations of the dilation and erosion filters are shown:

  • CPU:
    1. Using separable filters. (erosionCPU.cpp)
  • GPU:
    2. Naïve implementation, one thread loading n^2 elements per each pixel. (erosion.cu) 3. Separable filter implementation, the processing is divided in two steps and only 2*n elements are loaded per each pixel. (erosion.cu) 4. Shared memory implementation, a tiling approach is used. (erosion.cu) 5. The radio of the filter is templatized to enable unrolling of the main loop. (erosion.cu) 6. The filtering operation is templatized to reuse the same code for the erosion and the dilation. (erosionFuncTemplate.cu)

Performance

I have performed some tests on a Nvidia GTX 760.

With an image of 1280x1024 and a radio ranging from 2 to 15:

Radio / Implementation Speed-up CPU Naïve Separable Shared mem. Radio templatized Filter op. templatized
2 34x 0.07057s 0.00263s 0.00213s 0.00209s 0.00207s 0.00207s
3 42x 0.08821s 0.00357s 0.00229s 0.00213s 0.00211s 0.00210s
4 48x 0.10283s 0.00465s 0.00240s 0.00213s 0.00221s 0.00213s
5 56x 0.12405s 0.00604s 0.00258s 0.00219s 0.00219s 0.00221s
10 85x 0.20183s 0.01663s 0.00335s 0.00234s 0.00237s 0.00237s
15 95x 0.26114s 0.03373s 0.00433s 0.00287s 0.00273s 0.00274s

cuda-dilation-and-erosion-filters's People

Contributors

mompes avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.