Skip to content

Instantly share code, notes, and snippets.

@pgoeser
pgoeser / mat_to_py.py
Created November 24, 2011 23:27
quick converter for .mat files into loadable python
#!/usr/bin/env python
# this scripts converts a matlab mat-file to an importable python-file
import scipy.io.matlab as mio
from scipy import array
import re, pprint
def mat_to_py(matfile, pyfile=None):
if not pyfile:
pyfile = re.sub(".mat$",".py$",matfile)
@pgoeser
pgoeser / upscale_detect.sh
Created January 30, 2012 18:31
double-blind resolution test to detect upscales from 720p to 1080p
#!/bin/bash
# double-blind resolution test to detect upscales from 720p to 1080p
# usage: upscale-detect.sh filename
#
# what's it doing: taking two screenshots at a random spot in a file, once with the video downscaled to 720p and upscaled back to 1080p, once without scaling filters. The order of the screensots is randomized.
#
# results: everything is in /tmp/upscale-detect
# shots are shot_a.png and shot_b.png (uncompressed)
# the file doubleblind_secret reveals which was the original.
#