Graphs a video onto Desmos. Inspired by Junferno. Example: https://youtu.be/GHGoi_Fn-Wo
pip install PIL
pip install opencv-python
pip install numpy
pip install potrace
pip install json
pip install regex
pip install tkinter
Select the video you want to convert.
- Preprocessors (Pick one)
OTSU = Uses Otsu's method to determine the upper and lower bound
SIGMA_BALLS = Uses ... something that has to do with data (I really don't know how this works)
- Filters (Decreases the number of equations)
FILTERED = Uses bilateral filter to smooth out the image
L2 = Uses L2 gradient to better calculate the gradient magnitude
Open index.html
- Drag and zoom the viewport to make sure all of the image shows
- Press
SET STATE
- Press
Choose Files
and select all the latexn.txt
Once it's done rendering, the image sequence will directly download to your downloads folder
- Press
Allow
when it asks you if you want to let it download multiple files - It will ask you to
Allow
every 50 downloads/frames - Use a software/tool to combine the image sequence to a video
- Desmos is a graphing calculator
- Potrace is a software that turns bitmap images to vector (with beizer lines)
- It is recommended to use 10/15 fps and 360p/480p videos to reduce the number of frames you need to load
- Make sure to delete
graphs
folder before converting another video - You can press
SAVE STATE
to save the current state and useGET STATE
to return to that state even after reloading. - You can run multiple
index.html
and do them in batches. Make sure it's on a different window. - If you run into
OSError: [WinError 1450] Insufficient system resources exist to complete the requested service
, you should manually allocate the number of cores to use inPool(os.cpu_count())
toPool(NUMBER_OF_CORES)
Example: