Giter Club home page Giter Club logo

imageprocessing-2's Introduction

Parallel Image Processing using C++

The project explores the advantages of multithreading in image processing while comparing between three different implementations. Several image processing functions have been implemented and are available in each implementation for comparison.

Timers are used in all implementations in order to accurately measure the difference of implementations. At the end of each execution execution times are printed to the standard output.

Serial implementaion

In order to see the advantages of multithreading, the first execution mode is serial where a single operation is applied to a number of images and the processing is performed on a single thread.

In order to compile the serial implementation run the following command

$ make -f serialMakefile

OpenMP implementation

The second implementation uses the OpenMP libraries available for C/C++. OpenMP uses compiler directives in order to split the work on the available processors.

In order to compile the openMP implementation run the following command

$ make -f openmpMakefile

CilkPlus implementation

The third implementation uses the CilkPlus compiler which adds simple language extensions to the C and C++languages to express task and data parallelism.

In order to compile the CilkPlus implementation run the following command

$ make -f cilkplusMakefile

Dependencies

All three implementations depend on the following libraries in order to be able to open and manipulate images in different formats. The libraries need to be in the $INCLUDE_PATH and the $LD_LIBRARY_PATH.

  • libtiff
  • libpng
  • libjpeg

For the OpenMP implementation the OpenMP library needs to be installed on the system and finally for the CilkPlus implementation the CilkPlus compiler needs to be installed.

Execution

Depending on the implementation, three different executables will be generated, serial, openmp and cilkplus.

The following image processing functions are provided for comparison.

  • reverse color
  • adjust brightness
  • adjust contrast
  • convert RGB to Grey
  • convert Grey to RGB
  • convert RGB to Black and White
  • convert RGB to Sepia
  • rotate
  • scale
  • blur

The more intense the processing is the more the advantages of multithreading can be seen. For example, in order to reverse the colors of an image, all that is required is to invert the value of individual pixels which is not very computationaly intensive. On the other hand, trying to blur an image is more intensive thus running it on multiple cores can yield better execution time.

Upon execution, all implementation require an input folder with images and an ouput folder where the processed images will be stored. Furthermore, the operation to performed and further arguments required by the specific operation.

Here are a few examples.

Rotate all images in the input folder to the left

$ ./program input/folder output/folder -rotate -left

Blur all images in the input folder by 90%

$ ./program input/folder output/folder -blur 90

Convert all images to black and white

$ ./program input/folder output/folder -rgb2bw 0

imageprocessing-2's People

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.