Original link: http://www.concentric.net/~Ttwang/tech/inthash.htm
Taken from: http://web.archive.org/web/20071223173210/http://www.concentric.net/~Ttwang/tech/inthash.htm
Reformatted using pandoc
Thomas Wang, Jan 1997
last update Mar 2007
from __future__ import division | |
from numpy.fft import rfft | |
from numpy import argmax, mean, diff, log, nonzero | |
from scipy.signal import blackmanharris, correlate | |
from time import time | |
import sys | |
try: | |
import soundfile as sf | |
except ImportError: | |
from scikits.audiolab import flacread |
def tarjan(N, S, T, edges): | |
cnt = 0 | |
bridges = [] | |
visit = [0 for i in range(N)] | |
low = [N + 1 for i in range(N)] | |
ret = [False for i in range(N)] | |
q = [0 for i in range(N + 1)] | |
q[0] = (S, -1, -1) | |
top = 0 | |
while top >= 0: |
Original link: http://www.concentric.net/~Ttwang/tech/inthash.htm
Taken from: http://web.archive.org/web/20071223173210/http://www.concentric.net/~Ttwang/tech/inthash.htm
Reformatted using pandoc
Thomas Wang, Jan 1997
last update Mar 2007
import cv2 | |
import numpy as np | |
def in_front_of_both_cameras(first_points, second_points, rot, trans): | |
# check if the point correspondences are in front of both images | |
rot_inv = rot | |
for first, second in zip(first_points, second_points): | |
first_z = np.dot(rot[0, :] - second[0]*rot[2, :], trans) / np.dot(rot[0, :] - second[0]*rot[2, :], second) | |
first_3d_point = np.array([first[0] * first_z, second[0] * first_z, first_z]) |
(Codecs are extracted from https://web.archive.org/web/20120722124832/http://opencv.willowgarage.com/wiki/QuickTimeCodecs )
""" | |
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy) | |
BSD License | |
""" | |
import numpy as np | |
# data I/O | |
data = open('input.txt', 'r').read() # should be simple plain text file | |
chars = list(set(data)) | |
data_size, vocab_size = len(data), len(chars) |