-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New python script to generate video frames
I have added a new python video that generates the video frames for the zoom in and out video. I am now using a proportional zoom instead of different polynomials and this works perfect. Signed-off-by: Christian Rapp <[email protected]>
- Loading branch information
Showing
11 changed files
with
402 additions
and
151 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": { | ||
"collapsed": true | ||
}, | ||
"outputs": [], | ||
"source": [ | ||
"# Zoom values for Video frames\n", | ||
"\n", | ||
"This was a test to find a polynomial which generates good zoom values for video frames." | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 32, | ||
"metadata": { | ||
"collapsed": false | ||
}, | ||
"outputs": [], | ||
"source": [ | ||
"import numpy as np\n", | ||
"import matplotlib.pyplot as plt\n", | ||
"import numpy.polynomial.polynomial as poly" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 33, | ||
"metadata": { | ||
"collapsed": false | ||
}, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"250000.0\n" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"zoom_range = np.arange(1, 1250)\n", | ||
"x = np.array([1, 10, 100, 250, 500, 750, 1000])\n", | ||
"y = np.array([1, 2, 10, 100, 500, 30000, 250000])\n", | ||
"\n", | ||
"coefs = poly.polyfit(x, y, 6)\n", | ||
"#print(coefs)\n", | ||
"print(poly.polyval(1000, coefs))\n", | ||
"ffit = poly.polyval(zoom_range, coefs)\n", | ||
"\n", | ||
"#plt.plot(zoom_range, ffit)\n", | ||
"#plt.plot(x, y, 'bo')\n", | ||
"#plt.show()" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 34, | ||
"metadata": { | ||
"collapsed": false | ||
}, | ||
"outputs": [], | ||
"source": [ | ||
"fig = plt.figure(1)\n", | ||
"ax_1 = fig.add_subplot(211)\n", | ||
"ax_1.plot(zoom_range, np.log(zoom_range)**2, 'r', label=\"x^2\")\n", | ||
"ax_1.set_yscale('log')\n", | ||
"ax_1.legend()\n", | ||
"ax_2 = fig.add_subplot(212)\n", | ||
"ax_2.plot(zoom_range, zoom_range**2 / 20, 'b', label=\"x^3\")\n", | ||
"ax_2.set_yscale('log')\n", | ||
"ax_2.legend()\n", | ||
"plt.show()" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": { | ||
"collapsed": true | ||
}, | ||
"outputs": [], | ||
"source": [] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.5.1" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 0 | ||
} |
Oops, something went wrong.