Designed to turn a sideways perspective to a bird eye's view. Recommended for cameras attached on poles, minimum configuration needed.
Dependency
- OpenCv 4.4.0
Environnment
- Python 3.8.5
- Windows 10 2004
Run GetParametersParallel.py or GetParametersPerpendicular.py. Find two lines that are parrallel/perpendicular in real life, but aren't in the camera frame. These lines will delimit the final frame and warping, thus make sure to find lines that are close to the sides, the closer the better. Start with the first line, start from the top left and hold you mouse until you have reached the bottom of that line. Repeat this step, but on the top right. Check Images Below. The first one is for the parallel lines, second if for perpendicular lines.
Program will then exit after printing out 5 parameters calculated from the two given lines. Copy these numbers to BirdEyeView.py and run. Upon running, the camera's perspective will(hopefully) be changed to a bird eye view.
To find the final vertical scaling factor, the following has been used:
To find the camera angle, nonlinear curve fitting has been used:
Excel Sheet Here