• 大小: 66KB
    文件类型: .zip
    金币: 2
    下载: 0 次
    发布日期: 2024-02-05
  • 语言: C/C++
  • 标签: AAM代码  c++  

资源简介

这是用c++编程实现的AAM算法代码,大家可以学习一下。

资源截图

代码片段和文件信息

/****************************************************************************
* File Name:        AAMBuilding.cpp                                         *
* Copyright (C):    2006 2007 2008 by JIA Pei                             *
* Version:          0.2                                                     *
* Author:           JIA Pei                                                 *
* Contact:          jp4work@gmail.com                                       *
* URL:              http://www.visionopen.com                               *
* Create Date:      2008-03-04                                              *
* Main Content:     AAM building test file                                  *
* Used Library:     STL + OpenCV                                            *
****************************************************************************/


#include 
#include 
#include 
#include 
#include 
#include 

// used to distinguish POSIX and WIN32
#include 


#include “cv.h“
#include “highgui.h“
#include “ml.h“

#include “VO_Common.h“
#include “VO_IO.h“

#include “VO_AAMBasic.h“
//#include “VO_AAMICIA.h“


using namespace std;


int main ( int argc char *argv[] )
{
// specify the dataset to be used
int ds  = IMM; // IMM FRANCK XM2VTS

// specify the number of channels of the dataset
int nChan  = COLORCHANNELS;         // GRAYCHANNELS COLORCHANNELS

// specify the method to be applied
int med  = AAM_BASIC;                 // AAM_BASIC AAM_CMUINVERSECOMPOSITIONAL

// specify the texture extraction method
int tmd     = DIRECTTEXTURE;         // DIRECTTEXTURE LAPLACETEXTURE HARRISCORNERTEXTURE HISTOGRAMEQUALIZED GABOR SEGMENTATION

string                  hostImagePath hostAnnotatedPath trainedDataPath;
string                  prePath strWidth strHeight strNumOfSamples;
stringstream            ssWidth ssHeight ssNumOfSamples;
vector          AllAnnotatedFiles AllImgFiles4Training;
vector       imgs;
vector   shps;
vector   shps_LeftEye;
vector   shps_RightEye;
vector   shps_LeftEyeBrow;
vector   shps_RightEyeBrow;
vector   shps_Nose;
vector   shps_Mouth;
vector   shps_Cheek;

vector set_LeftEye;
vector set_RightEye;
vector set_LeftEyeBrow;
vector set_RightEyeBrow;
vector set_Nose;
vector set_Mouth;
vector set_Cheek;


// 1. Specify folders
// For Windows
#ifdef BOOST_REGEX_FI_WIN32_MAP

switch ( ds )
{
case XM2VTS: // 720*576
prePath             = “F:/Research/Database/XM2VTS/XM2VTS (CDS001+006)“;
break;
case FRANCK: // 720*576
prePath             = “F:/Research/Database/FRANCK“;
break;
case IMM: // 640*480
default:
prePath             = “F:/Research/Database/IMM“;
break;
}

// For Posix -- Portable Operating Sys

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2008-03-22 01:47  AAMBuilding\
     目录           0  2008-03-22 01:47  AAMBuilding\AAMBuilding\
     文件        4597  2008-03-06 12:11  AAMBuilding\AAMBuilding\VO_Triangle2D.h
     文件       21949  2008-03-21 20:27  AAMBuilding\AAMBuilding\VO_AAM.h
     文件       16235  2008-03-21 20:27  AAMBuilding\AAMBuilding\VO_AAMBasic.h
     文件        2772  2008-03-06 12:05  AAMBuilding\AAMBuilding\VO_AAMEdge.h
     文件        4966  2008-03-06 23:11  AAMBuilding\AAMBuilding\VO_AAMPoint2D.h
     文件        7321  2008-03-11 03:06  AAMBuilding\AAMBuilding\VO_AAMShape2D.h
     文件        5050  2008-03-19 01:05  AAMBuilding\AAMBuilding\VO_AAMTexture2D3C.h
     文件        5068  2008-03-10 14:47  AAMBuilding\AAMBuilding\VO_AAMTriangle2D.h
     文件        9248  2008-03-11 02:59  AAMBuilding\AAMBuilding\VO_AAMWarpingPoint.h
     文件       17784  2008-03-21 20:27  AAMBuilding\AAMBuilding\VO_ASM.h
     文件        5073  2008-03-21 23:54  AAMBuilding\AAMBuilding\VO_Common.h
     文件        2159  2008-03-18 19:05  AAMBuilding\AAMBuilding\VO_IO.h
     文件        4998  2008-03-18 19:06  AAMBuilding\AAMBuilding\VO_IO.cpp
     文件       66923  2008-03-21 20:34  AAMBuilding\AAMBuilding\VO_AAM.cpp
     文件       29359  2008-03-11 03:07  AAMBuilding\AAMBuilding\VO_AAMShape2D.cpp
     文件       13663  2008-03-09 22:08  AAMBuilding\AAMBuilding\VO_AAMTexture2D3C.cpp
     文件        7142  2008-03-10 15:50  AAMBuilding\AAMBuilding\VO_AAMWarpingPoint.cpp
     文件       40813  2008-03-21 20:29  AAMBuilding\AAMBuilding\VO_ASM.cpp
     文件        6689  2008-03-21 23:53  AAMBuilding\AAMBuilding\VO_Common.cpp
     文件       62244  2008-03-22 01:50  AAMBuilding\AAMBuilding\VO_AAMBasic.cpp
     文件        9396  2008-03-22 01:53  AAMBuilding\AAMBuilding\AAMBuilding.cpp
     文件        4850  2008-03-22 01:52  AAMBuilding\AAMBuilding\AAMBuilding.vcproj
     文件         899  2008-03-22 01:47  AAMBuilding\AAMBuilding.sln

评论

共有 条评论