This project attempted to implement a two-dimensional Image Distortion function using OpenGL based on the C++ language, and aims to create Interactive Image Deformation haing high DOF.
- High DOF User Interactive Program
- Local Deformation Parallel Calculation
For each control point, the movement from the original position to the position moved by drag is stored as a vector.
Set deformation weight using Gaussian equation so that pixels outside and within the deforamtion range are smoothly connected.
Deformed Texture coordinate = Existing Texture coordinates - Vector * Weight * Intensity (constant)
- Change VS file, SDK file
- Change image path
- Load images
- Adjust variables (SCR_WIDTH, SCR_HEIGHT)
- Right mouse button click : Add contorl point / Delete the control point
- Left mouse button drag : Move control point
- ESC : End the program
- Up : Reduce the deformation range
- Down : Increase the deformation range
- Left : Decrease the deformation intensity
- Right : Increase the deformation intensity
- R : Show/Hide the deformation ranges
- P : Show/Hide the deformation points
- Z : Compare the before and after images