Changeset 112


Ignore:
Timestamp:
09/08/2009 12:23:04 PM (10 years ago)
Author:
dave
Message:

added python wrap

Location:
foam/trunk
Files:
4 added
6 edited

Legend:

Unmodified
Added
Removed
  • foam/trunk/faceclassifier/src/App.cpp

    r111 r112  
    2424using namespace std; 
    2525 
    26 int w=50; 
    27 int h=80; 
    28  
    29 //int w=20; 
    30 //int h=30; 
     26//int w=50; 
     27//int h=80; 
     28 
     29int w=20; 
     30int h=30; 
    3131 
    3232App::App(const string &filename) : 
     
    5959         
    6060        PCA pca(w*h); 
    61         FILE *f=fopen("../no-redist/eigenspaces/spacek-50x80.pca", "rb"); 
    62         //FILE *f=fopen("../data/eigenspaces/spacek-20x30.pca", "rb"); 
     61        //FILE *f=fopen("../no-redist/eigenspaces/spacek-50x80.pca", "rb"); 
     62        FILE *f=fopen("../data/eigenspaces/spacek-20x30.pca", "rb"); 
    6363        pca.Load(f); 
    6464        fclose(f); 
  • foam/trunk/vision/Makefile

    r96 r112  
    1515 
    1616CCFLAGS = `pkg-config --cflags opencv` -ggdb -Wall -O3 -ffast-math -Wno-unused -DTIXML_USE_STL  
     17LIBS    = `pkg-config --libs opencv`  
     18PYTHON_INCLUDE = -I/usr/include/python2.5 
    1719 
    1820CC = g++ 
     
    4547distclean:: clean 
    4648 
     49python:: ${TARGET} 
     50        swig -c++ -python src/vision.i  
     51        g++ ${CCFLAGS} -c src/vision_wrap.cxx ${PYTHON_INCLUDE} 
     52        g++ -shared ${OBJS} vision_wrap.o ${LIBS} -o _vision.so 
     53        cp _vision.so ../python 
     54        cp src/vision.py ../python 
     55         
  • foam/trunk/vision/src/FileTools.cpp

    r111 r112  
    2020using namespace std; 
    2121 
     22FILE *OpenFile(char * filename, char *mode) 
     23{ 
     24        return fopen(filename,mode); 
     25} 
     26 
     27void CloseFile(FILE *f) 
     28{ 
     29        fclose(f); 
     30} 
     31 
    2232vector<string> Glob(const string &path) 
    2333{ 
  • foam/trunk/vision/src/FileTools.h

    r99 r112  
    1818#include<vector> 
    1919 
     20// for the python interface 
     21FILE *OpenFile(char * filename, char *mode); 
     22void CloseFile(FILE *); 
     23 
    2024std::vector<std::string> Glob(const std::string &path); 
  • foam/trunk/vision/src/Image.cpp

    r96 r112  
    3030{ 
    3131        m_Image=cvLoadImage(filename.c_str()); 
     32        if (m_Image==NULL) cerr<<"Could not open image: "<<filename<<endl; 
     33        assert(m_Image); 
     34} 
     35 
     36Image::Image(char *filename) 
     37{ 
     38        m_Image=cvLoadImage(filename); 
    3239        if (m_Image==NULL) cerr<<"Could not open image: "<<filename<<endl; 
    3340        assert(m_Image); 
  • foam/trunk/vision/src/Image.h

    r94 r112  
    2828        Image(int w, int h, int d, int c); 
    2929        Image(const std::string &filename); 
     30        Image(char *filename); 
    3031        Image(const Image &other); 
    3132        Image(const IplImage *other); // copies the given image 
Note: See TracChangeset for help on using the changeset viewer.