Linear Algebra, Mathematics, Math, Principal Component, Python.
self-explanatory by their names. def create_data_matrix_from_video(clip, k=5, scale=50): return np.vstack([scipy.misc.imresize(rgb2gray(clip.get_frame(i/float(k))).astype(int), scale).flatten() for i in range(k * int(clip.duration))]).T def rgb2gray(rgb): return np.dot(rgb[...,:3], [0.299, 0.587,