Skip to content
Thib edited this page Jan 3, 2023 · 1 revision

Project's Notice

Package installation

Before going further, please install the following packages:

  • Numpy:
pip install numpy
  • Matplotlib:
python -m pip install -U pip
python -m pip install -U matplotlib
  • scikit-learn:
pip install -U scikit-learn
  • OpenCV:
pip install opencv-python

How to use the algorithm ?

The only file that needs to be modified is the main.py.

You need to:

  • Modifiy the 4 paths that need to be provided:

    • original_frames: the folder that contains all the frames from the original video as .jpg.
    • edges_frames: the folder that will contain all the frame converted to Canny Edge Detection.
    • dense_flow_frames: the folder that will contain all the frame with Dense Optical Flow.
    • video_folder: the folder that will contain the video rendered by the algorithm.
  • Modify the video parameters:

    video = CreateVideos((400,320), 3)

    • The size of the video must match the image size in the original_frames folder (for instance (400,320))
    • Specify the number of frames per second (for instance 3)

You are ready to launch the algorithm !

What to do when the algorithm has been launched

  1. Click on the image to points out the interface. It is normal that the points are not drawn while clicking, they will be shown once the number of points specified has been reached.
  2. Once the number of points has been reached, press a key on your keyboard.
  3. The validation curve of our Model appears. (just here for information)
  4. Then the Polynomial Regression appears with its equation. The equation do not take into account the rotation of the curve !

The Output

As output, you will have:

  • Canny Edge Detection images
  • Dense Optical Flow images
  • Original Video
  • Dense Optical Flow video