Code Monkey home page Code Monkey logo

morphopscuda's Introduction

MorphOpsCUDA

Mathematical morphological operators implementation in CUDA (parallel version), three versions are avaiable: check out branches. A report is included.

Overview

An implementation of morfological operators, in order to compare it with the sequential C++ version (here) and measure speedup.

Code works with .ppm B/W images, extracting only the first channel if multiple channels are detected. Results are also .ppm images, timings are always saved in a .csv file.

Regarding operators, multiple shapes are avaiable: you can even set a custom sizes. Check out StructuringElement.h.

MorphableOperators.h contains implementations of some well know tranformations: erosion, dilatation, opening, closing, top-hat and bottom-hat transform. Derived transformations were implemented calling base transformations methods.

Versions

Every version stores the structuring element in constant memory.

master: branch use shared memory for store locally each tile, compute the transformation on that tile and writes back in global memory. Tile's paddin is managed by two threads.

optimized-padding: works as above, except for padding's loading: this time all threads on the border work to load the padding.

no-shared-memory: pretty explicative, works without shared memory. Every read and write operation is done on global memory.

Results

GPU timings were recorded on a Nvidia K80, CPU timings on a AMD Ryzen 1600; every GPU version was tested varing input tile's size from 8 to 32. 5 images from 400x400 5000x5000 were used for the test, below a table with three images and tile's size set to 16, full data can be found on the report.

Timings are in seconds.

Img res Operation CPU master_16 optimized-padding_16 no-shared-memory_16
432x596 Erosion 0,0188 0,0005 0,0004 0,0003
432x596 Dilatation 0,0380 0,0011 0,0008 0,0006
995x1134 Erosion 0,4960 0,0142 0,0112 0,0082
995x1134 Dilatation 1,0288 0,0284 0,0225 0,0164
4871x6466 Erosion 2,0761 0,0584 0,0464 0,0339
4871x6466 Dilatation 4,1218 0,1180 0,0935 0,0678

morphopscuda's People

Contributors

rickie95 avatar

Stargazers

 avatar Dariusz Szarejko avatar Angelo D'Amante 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.