Giter Club home page Giter Club logo

cuda-image-processing's Introduction

Created by Rob Golshan (uteid: rpg499)

Credit: main.cpp: GL functions / idea of the image loop taken from NVIDIA cuda sample code convolution.cu: Algorithms implemented based on convolutionSeparable.pdf in cuda sample code and a parallel implementation of algorithms in https://web.archive.org/web/20060718054020/http://www.acm.uiuc.edu/siggraph/workshops/wjarosz_convolution_2001.pdf

What does the program do?

This is an implementation of several image processesing algorithms utilizing the parallelism of an NVIDIA GPU via CUDA. Algorithms implemented are:

  1. 2D Convolution in parallel that works with any kernel (i.e. filter matrix)
  • O(radius^2) assuming all blocks run in parallel
  1. 2D Convolution in parallel similar to #1, but uses shared memory. Works with any kernel.
  • This is faster than #1.
  • Shared memory requirements are (BLOCK_SIZE x kernel radius) squared
  • Could possibly be faster (but same time complexity) by loading the source image in a texture
  1. 2D Convolution in parallel with SEPARABLE kernels ONLY.
  • Split into two functions that compute convolution of rows or convolution of columns
  • O(radius) assuming all blocks run in parallel
  1. Boxfilter
  • Similar to #3, but uses properties of box filters to keep time low when using a big radius
  • O(width+height) assuming all blocks run in parallel
  • Could possibly be faster (but same time complexity) by loading the source image in a texture
  • Time taken independent of radius size
  • Multiple iterations of this similate a Guassian filter

Filters I purposely did not implement:

  1. FFT filter
  • Requires more math knowledge than I currently have
  • Implementation would be padding kernel/image and using FFT library in cuda
  • Slower than separable implementation
  • Should only really be needed with using BIG kernels that are not separable
  1. Guassian filters
  • We can either use a separable filter (#3) or a box filter several times (#4) to get the same result

Any other filters I didn't implement were either because I thought it was already a filter mentioned earlier, or I missed it in my research

Why use this over NVIDIA sample code? There is no reason. I doubt my implementations are any faster than the samples provided.

BUILDING

Build with make

Tested and built on a single GPU system with a GTX 980 (compute capability 5.2) Have Xwindow system enabled to visually see results

Must either use the sample lena.ppm or have your own ppm image file

Running

./convolution --image [path to image]

While the program is running and the XWindow is in focus, press h for a help command.

cuda-image-processing's People

Contributors

rpgolshan avatar

Watchers

 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.