Design Using C++ Final Project
This is the image manipulation library implemented in C++. We have the following features:
- Grayscale
- Convolution
- Image Warping
- Photo Mosaic
Goal :
We aim to provide a library package that can treat images with some amazing effects. The GrayScale and Convolution is the basic operation for the image manipulation and widely used. The image warping can be used to make some pictures fit in different shapes. For example, if the company wants to add the advertisement on some irregular surfaces, image warping can help the company to make the logo better fit in that surfaces in the picture. The photo mosaic can be used for business communication. For example, it can be used to document the parties or events with the company's logo as the target images and the employees and event pictures as the source images.
Download dependent lib
via this
link and unzip the folder in the project directory.
Install any future dependencies into the lib
folder.
Current dependencies include:
armidillo
for linear algebra,libjpeg
andlibpng
for decoding imagesboost GIL
for reading images
You will need to run ./install.sh
to finish setting up these dependencies. ENSURE YOU HAVE NO WHITESPACE IN YOUR DIRECTORY PATH.
- First generate precompiled headers
imgmanip/imgio/pch.h.gch
- Build the main program
make
- Run the program
./main
For future tests, write additional make entry in Makefile.
Usage options:
./main —-mosaic 'tgtImage.png' ‘srcDirectory'
./main ——homography 'srcImage.png' ['trapezoid' | 'spiral' | 'rTrapezoid' | 'random']
./main --grayscale 'srcImage.png'
optional: --shades intNumber
For custom usage, modify main function and choose from our wide range of tools
Each subdirectory in imgmanip
is a "module." Remember to update Makefile when you add a new "module."
Mosaic image: