Coder Social home page Coder Social logo

parallel-algorithms-2023's Introduction

Optimization of median filter (parallel algorithms assignment)

This repository contains an implementation of median filter. The project aims to explore optimization possibilities for the algorithm. This task was issued at the University of Miskolc, Hungary in 2023.

Precautions

The project uses a custom naive BMP parser, which is not suitable for processing any BMP file.

BMPs with the following parameters can be used:

Usage

Project is configured to build with MSVC, but the code itself is intended to be portable.

Executable binary (win-x64) and sample images can be downloaded from Releases page.

Noise generation

To generate noise to an image, run:

parallel.exe generate-noise <percentage> <input-files> <output-folder>

NOTE, that the output directory must exist before running the command, otherwise the output will not be saved. If the output file is already exists, the program will overwrite it.

E.g. to generate 15% noise to the input image, run:

parallel.exe generate-noise 0.15 ./img/0.bmp ./output

Median filtering

To apply median filter to an image, run:

parallel.exe median-filter <kernel-size> <sorting-function> <thread-count> <input-files> <output-folder>
Parameter Description
kernel-size Size of the kernel to be used. It is a single number (e.g. input 3 produces a 3x3 kernel).
It is recommended to use an odd number.
sorting-function Sorting method to be used. Possible values are: bucket, bucket-parallel, quick, quick-parallel
thread-count Number of threads to be used. Possible values are:
1: serial execution,
0: dynamic parallel execution (OpenMP determines thread count),
greater than zero: fixed thread count
input-files Images to process. It can be multiple files, delimited by |, e.g. pic0.bmp|pic1.bmp|pic2.bmp.
output-folder Path to a directory, where output files should be stored. The output files are named the same as the input.

NOTE, that the output directory must exist before running the command, otherwise the output will not be saved. If the output file is already exists, the program will overwrite it.

E.g. to filter multiple images using a 3x3 kernel, quicksort algorithm, and 8 threads, run:

parallel.exe median-filter 3 quick 8 pic0.bmp|pic1.bmp|pic2.bmp ./out

Examples can be found here.

Sample images used

Sample images are published under certain Creative Commons licenses. Check URLs for more information.

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.