Ignore:
Timestamp:
09/09/2009 12:19:44 PM (11 years ago)
Author:
dave
Message:

first pass expression recgn

File:
1 edited

Legend:

Unmodified
Added
Removed
  • foam/trunk/python/build-pca.py

    r112 r113  
    11#!/usr/bin/env python 
    22 
    3 import glob 
     3import glob,string 
    44from vision import * 
     5from faces import * 
    56 
    6 imagepath = "../no-redist/spacek-large/*.png" 
    7 images = glob.glob(imagepath) 
    8 w = 20 
    9 h = 30 
    10 pca = PCA(w*h) 
     7#get_faces("../no-redist/yalefaces/orig/*.png", "../no-redist/yalefaces/processed/") 
     8# calculate("../no-redist/spacek-large/*.png",20,30,"test.pca") 
    119 
    12 for image in images: 
    13         im = Image(image) 
    14         v = im.Scale(w,h).RGB2GRAY().ToFloatVector() 
    15         pca.AddFeature(v) 
    16  
    17 pca.Calculate() 
    18  
    19 f = OpenFile("test.pca", "wb") 
    20 pca.Save(f) 
    21 CloseFile(f) 
     10build_pca("../no-redist/yalefaces/processed/*.png",20,30,"yalefaces-expression-20x30.pca") 
Note: See TracChangeset for help on using the changeset viewer.