The bulk of this code is taken directly from OpenCV's usage example.
calibrate.py
with the chessboard height and width (flags -h
and -w
) and the input video file name (flag -v
). Example:python calibrate.py -h 7 -w 7 -v VIDEOFILE
Note that the height and width is determined by the number of INTERSECTION POINTS along each axis and not by number of squares.
python calibrate.py
to generate calibration parameter file.The bulk of this code is taken directly from OpenCV's usage example. Simple run:
python unbarrel.py -f 10 -px 10 -v VIDEOFILE
The argument flags are
-f
: fps \
-px
: image resolution in px/mm \
-v
: video file name
for example the above line will launch the script using 'calibration_parameters_10px.npz' and sets the output video at 10 frames per second. The -v flag can also take more than one video file. For this the filenames can be entered with spaces in between, or using wildcard to pattern match a bulk of files (e.g. -v *.mp4 will run the unbarrel procedure on every .mp4 in the directory).
cropper.py
is just there to trim the clips with a graphic update to keep track of how things look. The GUI usage was copied from pyimagesearch's tutorial for a similar work.
-v
for video filename (without the extension) and -f
for framerate.