The project is related to Nearest neighbor interpolation technique for image rotation. We read the user input for rotation angle, and then create a transformation matrix. Later, we multiply the destination image coordinates with the inverse of this transformation matrix to get the corresponding source image coordinates. After some rounding off operation, we get the nearest coordinates. The project uses OpenCV only for rmatrix manipulations and not for the nearest neighbor interpolation itself.
- You have OpenCV version 3 or greater on your machine
- You have a C++ 11/14 compiler
- You have the CMake build system
Arun Kumar Devarajulu - University of Maryland, College Park, MD, USA
This project is released under the MIT License
git clone https://github.com/arunumd/ImageRotationNearestNeighborCpp.git
cd ImageRotationNearestNeighborCpp
mkdir build
cd build
cmake .. && make
./ImageTransform <input file name> <output file name> <rotation-angle>
Original image | Rotated image |
---|---|
![]() |
![]() |