Image Geometric Transformations
This python file is used to perform various types of Geometric Transformation such as -
- Perspective Change - Zoom In/Zoom Out - Right/Left - X/Y Axis (8 functions)
- Translation - Positive/Negative - X/Y Axis (4 functions)
- Scaling - Positive/Negative - X/Y/XY Axis (6 functions)
- Shearing - Positive/Negative - X/Y Axis (2 functions)
- Rotation - X/Y/Z Axis (3 functions) (Angle Parameter in Degree)
- Flipping - X/Y Axis (2 functions)
All the functions have basic parameters of passing the Image, Image Width and Image Height along with passing of the Geometric Transformation FACTOR which is different for each type of transformation.
Using this Python Script -
- Download the “GeometricTransformations.py” file from the repository “img-geometric-transformation”.
- Keep this file in same directory as your python files.
- Use “import GeometricTransformations as gt” in your python file.
- Use the functions with ‘gt’, for example - “gt.rotateX(image, imageWidth, imageHeight, 60)” will return a rotated image by +60 degrees along X Axis.
Testing the Python Script -
- Clone the repository.
- Add a test image (e.g. “test.jpg”) to the folder.
- Open command line and change directory to same folder path as this repository.
- Run the following command and follow the instructions
> python main.py "path_to_image"
- Example
> python main.py "test.jpg"