之前运行haar特征的adaboost算法人脸检测一直出错,加上今天的HOG&SVM行人检测程序,一直报错。
今天总算发现自己犯了多么白痴的错误——是因为外部依赖项lib文件没有添加完整,想一头囊死啊
做程序一定要心如止水!!! 仔细查找!!!
1.人脸识别程序:
#include "cv.h"
#include "highgui.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <math.h>
#include <float.h>
#include <limits.h>
#include <time.h>
#include <ctype.h>
using namespace std;
static CvMemStorage* storage = 0;
static CvHaarClassifierCascade* cascade = 0;
void detect_and_draw( IplImage* image );
const char* cascade_name =
"G:/OpenCV2.3.1/data/haarcascades/haarcascade_frontalface_alt.xml";
/* "haarcascade_profileface.xml";*/
int main()
{
CvCapture* capture = 0;
cascade = (CvHaarClassifierCascade*)cvLoad( cascade_name, 0, 0, 0 );
if( !cascade )
{
fprintf( stderr, "ERROR: Could not load classifier cascade/n" );
//fprintf( stderr,
//"Usage: facedetect --cascade=/"<cascade_path>"/[filename|camera_inde