Imstable is an image rotation/stabilisation library. Image rotation is a common image processing operation, let's give it a try. This is mostly an exercise in C++ and Cmake in my attempt to become better at them.
Given an input PGMA image, a rotation angle, and coordinates for the crop rectangle, using imstable you can get the following output:
Command:
./imstable_demo.exe -f ../assets/lena.ascii.pgm -o rotate -a +20 -cx 200 -cy 200 -ch 200 -cw 200
Input image:
Output image:
On Linux:
git clone https://github.com/electrodonkey/imstable.git
cd imstable
mkdir build && cd build
cmake .. -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release # or Debug
make
On Windows (mingw32-make needs to be installed and the commands should be run from Git Bash):
git clone https://github.com/electrodonkey/imstable.git
mkdir build && cd build
cmake .. -G "MSYS Makefiles" -DCMAKE_BUILD_TYPE=Release # or Debug
make
- reading a PGM (Portable Gray Map)file
- CW90, CCW90, FlipHoriz, FlipVertical
- rotation from pivot point
- bilinear interpolation of pixels
- crop
- crop to largest rectangle
- Irfanview on Windows
- Imagemagick on Linux and Windows
- CMake >= 3.19
- GCC toolchain (8.1.0 used)
- Doxygen (to generate documentation)
- All PGM files have only one comment on the 2nd line
- Currently only (P2) PGMA files are supported