source: foam/trunk/python/anim_pca @ 114

Revision 114, 576 bytes checked in by dave, 10 years ago (diff)

added a load of tools for previewing eigenspaces

  • Property svn:executable set to *
Line 
1#!/usr/bin/env python
2
3from faces import *
4from math import *
5import os
6import sys
7
8if sys.argv[1] == "-h":
9        print("anim_pca pcafile width height starteigenface endeigenface gain frames")
10       
11pca = load_pca(sys.argv[1])
12w=int(sys.argv[2])
13h=int(sys.argv[3])
14
15for i in range(0,int(sys.argv[7])):
16        img = smp.toimage( make_eigenfaces_image(w,h,pca,int(sys.argv[4]),int(sys.argv[5]),float(sys.argv[6])*sin(i*0.1)))
17        filename = "frames/out-%0.5d.jpg"%(i)
18        print filename
19        img.save(filename)
20
21os.system("mencoder mf://frames/*.jpg -oac lavc -ovc lavc -of mpeg -ofps 25 -o out.avi")
Note: See TracBrowser for help on using the repository browser.