evanhutomo / image-processing-cpp

An image processing application programmed in c++

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Image-Processing-cpp

  • This project presents a non exhaustive list of image processing algorithms. The algorithms are implemented in C and C++ and all images used are in pgm format.

Prerequisites

  • To follow this tutorial, you need to install the g++ compiler on your PC.
  • All examples here are based on a Linux environment but can be easily adapted for Windows based environments.

Compiling the code

  • Clone this repo into your environment and cd into the ImageProcessing folder:
git clone https://github.com/Yuhala/image-processing-cpp.git && cd ImageProcessing

Compile the program:

sudo g++ main.cpp Image.cpp -o app

How to use the program

  • The program presents 26 image processing algorithms. Logic operations, mathematical operations, convolutions and filters, and calculating an image histogram, image luminance, and contrast enhancement algorithms.
  • The program can take 3, 4, or 5 arguments, including the name of the binary (arg 0).
  • The sample images used are in the images folder and are all .pgm format.
  • The image resulting from each operation is generated in the output.pgm
  • Below is a list of some of the operations provided by the program and how you can test them on images.

Logic Operations (6)

  • Image binarization based on Otsu's thresholding algorithm: ./app otsuBinarize images/lena.pgm

alt-lena alt-lena-otsu

  • Logic NOT: ./app not images/lena.pgm

alt-lena alt-not-lena

  • Logic XOR: ./app images/lena.pgm xor images/aya.pgm

alt-lena alt-aya alt-lena-xor-aya

Convolution and Filters (9)

  • Gauss Filter: ./app gaussFilter images/aya.pgm

alt-lena alt-not-lena

  • Laplacien Convolution: ./app laplacienConvo images/lena.pgm

alt-lena alt-not-lena

Documentation

  • A full list of all the implemented algorithms can be found in page 2 of documentation.
  • Enter each operation in camel case when testing, just like in the examples above.

Some useful linux commands for images

  • Resize an image: convert img.png -resize 300x300\> output.png (Target size in this example is 300x300).
  • Identify image resolution (width x height): identify -format "%wx%h" image.png (Install imagemagick linux package).

Authors

  • Peterson Yuhala
  • petersonyuhala@gmail.com
  • Feel free to contact me for more info or to propose fixes.
  • Disclaimer: I am not an image processing expert and this code is meant solely for educational purposes.

License

  • This project is licensed under the MIT License - see the LICENSE file for details

About

An image processing application programmed in c++

License:MIT License


Languages

Language:C++ 68.0%Language:Makefile 20.5%Language:C 6.5%Language:Shell 4.8%Language:NASL 0.3%