Skip to content

Instantly share code, notes, and snippets.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#!/usr/bin/env python
"""
Usage:
stabilise.py [options] <video>
stabilise.py (-h | --help)
Options:
-s COUNT, --skip=COUNT Skip the first COUNT frames. [default: 0]
-d COUNT, --duration=COUNT Process COUNT frames.
"""
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import numpy as np
from scipy.signal import fftconvolve
from scipy.ndimage import maximum_filter
from dtcwt.backend.backend_numpy.lowlevel import reflect
import dtcwt.backend.backend_numpy as dtcwt_backend
def conv(X, h):
# Extend X reflecting appropriately
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rjw57
rjw57 / doctor-who-video.sh
Last active December 28, 2015 18:39
A little script to pull the background images from http://www.bbc.co.uk/news/entertainment-arts-24957282 into a single video
#!/bin/bash
#
# A script for Unix-like Operating Systems to download a little animated tour of the TARDIS.
#
# Run this file via "sh doctor-who-video.sh" or make it executable and run directly.
# Download all frames
for i in `seq -w 150`; do
wget "http://news.bbcimg.co.uk/news/special/2013/newsspec_6050/img/tardis/desktop/m/doctor$i.png"
done
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Running NumPy colfilter...
100 loops, best of 3: 16.12 ms
Running OpenCL colfilter...
100 loops, best of 3: 3.08 ms
Speed up: x5.23
=====
Running NumPy coldfilt...
100 loops, best of 3: 11.18 ms
Running OpenCL coldfilt...
1000 loops, best of 3: 1.95 ms
Running NumPy colfilter...
100 loops, best of 3: 15.98 ms
Running OpenCL colfilter...
100 loops, best of 3: 3.10 ms
Speed up: x5.16
=====
Running NumPy coldfilt...
100 loops, best of 3: 11.24 ms
Running OpenCL coldfilt...
1000 loops, best of 3: 1.96 ms