The aim of this project is to compensate for the motion in a video. Intutively, we first detect the motion and then apply a transformation that is opposite to the detected motion. The fooling are the steps followed:
- Detect feature points
- Track those feature points
- Estimate motion
- Apply inverse transformation
I used Lucas-kanade tracter to track the feature points.
-
Clone the github repository
git clone https://github.com/sakshikakde/video_motion_compensation.git
-
Go to the repositiory folder
cd video_motion_compensation
and create a build directorymkdir build
. Go to the build directorycd build
. -
Run the following commands to build the project.
cmake ..
make
-
The executable will be generated in the build folder. To run the program, use the following command.
./VideoStabilization ../dataset/motion_video2.mp4
I am using an affine warp for this example. As it can be seen, the output is a little noisy. It can be improved by using projective transformations.
https://learnopencv.com/video-stabilization-using-point-feature-matching-in-opencv/