axelvanherle / imgConvolutionCuda-C

Written by Sem Kirkels, Nathan Bruggeman and Axel Vanherle. Grayscales an image, applies convolution, maximum pooling and minimum pooling.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

imgConvolutionCuda-C

Archived because the course is closed, and this task was graded.

To run the code, it relies on having the stb_image.h and stb_image_write.h in the local dir.

This was an assigment for the course Hardware Accelerated Computing.

An application written by Sem Kirkels, Nathan Bruggeman and Axel Vanherle in C and using CUDA that manipulates a image using convolution, and applies maximum and minimum pooling.

What is it?

This application reads 10 images, and processes them using convolution, applies maximum and minimum pooling.

The application calculates the 2D Convolution on these images as in following figure:

image

Another example:

image

The results get saved into another image.

The application also calculates the maximum and minimum pooling.

Example:

image

We wrote the application in C with and without CUDA, so we can compare the speed gained.

Benchmarks

The threads in C is only faster because the files get writen away in these threads aswell. In CUDA it gets done sequential, the theards was a proof of concept that it can be accelerated even more.

Program Time
Sequential C 188.987s
Threads C 85.763s
CUDA Total 168.849s
CUDA Kernels 0.571s

Sources

We used the image loader: stb_image.h and the image writer: stb_image_write.h from https://github.com/nothings/stb.

Images are provid by the proffesor of this course, https://github.com/cteqeu/.

About

Written by Sem Kirkels, Nathan Bruggeman and Axel Vanherle. Grayscales an image, applies convolution, maximum pooling and minimum pooling.

License:MIT License


Languages

Language:Jupyter Notebook 62.9%Language:C 22.2%Language:Cuda 14.9%