资源简介
本人根据模式识别教材写的朴素贝叶斯分类器,用于人脸识别,人脸参数化方式为,把人脸分为9个区域,计算9个区域的黑白对比度,希望能抛砖引玉,人脸库请自己下载

代码片段和文件信息
// bmp_display.cpp : 定义应用程序的入口点。
#include “stdafx.h“
#include “bmp_display.h“
#include
#include
#include
#include
#define MAX_LOADSTRING 100
#define TIMER_SEC 1
HINSTANCE hInst;
TCHAR sztitle[MAX_LOADSTRING];
TCHAR szWindowClass[MAX_LOADSTRING];
ATOM MyRegisterClass(HINSTANCE hInstance);
BOOL InitInstance(HINSTANCE int);
LRESULT CALLBACK WndProc(HWND UINT WPARAM LPARAM);
INT_PTR CALLBACK About(HWND UINT WPARAM LPARAM);
int APIENTRY _tWinMain(HINSTANCE hInstance
HINSTANCE hPrevInstance
LPTSTR lpCmdLine
int nCmdShow)
{
UNREFERENCED_PARAMETER(hPrevInstance);
UNREFERENCED_PARAMETER(lpCmdLine);
MSG msg;
HACCEL hAccelTable;
get_distribution_param(“./MITEX/faces/““./MITEX/nonfaces/“);
LoadString(hInstance IDS_APP_title sztitle MAX_LOADSTRING);
LoadString(hInstance IDC_BMP_DISPLAY szWindowClass MAX_LOADSTRING);
MyRegisterClass(hInstance);
if (!InitInstance (hInstance nCmdShow))
{
return FALSE;
}
hAccelTable = LoadAccelerators(hInstance MAKEINTRESOURCE(IDC_BMP_DISPLAY));
while (GetMessage(&msg NULL 0 0))
{
if (!TranslateAccelerator(msg.hwnd hAccelTable &msg))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
return (int) msg.wParam;
}
ATOM MyRegisterClass(HINSTANCE hInstance)
{
WNDCLASSEX wcex;
wcex.cbSize = sizeof(WNDCLASSEX);
wcex.style = CS_HREDRAW | CS_VREDRAW;
wcex.lpfnWndProc = WndProc;
wcex.cbClsExtra = 0;
wcex.cbWndExtra = 0;
wcex.hInstance = hInstance;
wcex.hIcon = LoadIcon(hInstance MAKEINTRESOURCE(IDI_BMP_DISPLAY));
wcex.hCursor = LoadCursor(NULL IDC_ARROW);
wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
wcex.lpszMenuName = MAKEINTRESOURCE(IDC_BMP_DISPLAY);
wcex.lpszClassName = szWindowClass;
wcex.hIconSm = LoadIcon(wcex.hInstance MAKEINTRESOURCE(IDI_SMALL));
return RegisterClassEx(&wcex);
}
BOOL InitInstance(HINSTANCE hInstance int nCmdShow)
{
HWND hWnd;
hInst = hInstance;
hWnd = CreateWindow(szWindowClass sztitle WS_OVERLAPPEDWINDOW
CW_USEDEFAULT 0 CW_USEDEFAULT 0 NULL NULL hInstance NULL);
if (!hWnd)
{
return FALSE;
}
ShowWindow(hWnd nCmdShow);
UpdateWindow(hWnd);
return TRUE;
}
LRESULT CALLBACK WndProc(HWND hWnd UINT message WPARAM wParam LPARAM lParam)
{
PAINTSTRUCT ps;
HDC hdc;
static long dir_hand = 0;
static struct _finddata_t c_file;
static FILE * stream;
static float features[20];
static unsigned char image_buf[1200];
static unsigned char image_buf2[1200];
static unsigned char tmp_buf[400];
static unsigned char info_buf[1478];
static BITMAPINFO image_head;
static unsigned int stop;
static char file_dir[50];
static char info_text[100];
static int is_face;
int iindex;
switch (message)
{
case WM_CREATE:
dir_hand = _findfirst(“./MITEX/faces/*.bmp“&c_file);
if(dir_hand
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 20190 2009-11-30 09:40 bmp_display.cpp
文件 548 2009-11-27 14:00 bmp_display.h
----------- --------- ---------- ----- ----
20738 2
- 上一篇:3DGIS开发平台比较
- 下一篇:PE病毒的学习资料包
相关资源
- 基于动态分类器集成选择和GM(21)
- 朴素贝叶斯分类模型完整代码
- opencv_traincascade训练分类器,手势识别
- 基于决策树和朴素贝叶斯算法对Adul
- 基于最小错误率的贝叶斯手写数字分
- 贝叶斯应用案例测试集及源码
- 论文研究 - 软件可靠性对数非均匀泊
- 论文研究 - 从众包中提取信息:采用
- 基于朴素贝叶斯分类法的图像分割
- α-P烯热异构化反应速率常数评价
- PCA分类器论文+代码实现+训练测试图像
- 论文研究-基于改进贝叶斯优化算法的
- 论文研究-Hammerstein-Wiener系统的递推贝
- opencv内置各种分类器
- Bayesian Networks in R贝叶斯网络的R语言实
- 人车分类识别 HOG特征+KNN分类器
- opencv自带SVM分类器使用程序
- 贝叶斯预测方法
- 贝叶斯网络之父:Judea Pearl论文集1
-
haarcascades人脸特征分类器xm
l文件 - 贝叶斯网引论-清晰版
- 朴素集合论---刘壮虎
- 机器学习实战项目贝叶斯拼写检查器
- 背景建模运动检测_高斯混合模型_三帧
- 贝叶斯数据分析 Third Edition (C - Gel
- Random Ferns 分类器
-
OpenCV生成xm
l分类器文件 - winbugs14:层次贝叶斯建模软件
- 基于Hadoop架构的文本分类算法
- 贝叶斯网络和HMM
评论
共有 条评论