Skip to content

Yuhala/image-processing-cpp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

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
  • [email protected]
  • 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++

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published