资源简介
图像特征提取代码,包括LBP、HOG、Haar、Zernike矩、Hu矩特征,.h文件有如何调用的详细说明,C/OpenCV程序

代码片段和文件信息
#include “stdafx.h“
#include “HaarFeature.h“
#pragma once
#include “.\\include\cv.h“
#include “.\\include\highgui.h“
#include “.\\include\cxcore.h“
#pragma once
#pragma comment(lib“cv210.lib“)
#pragma comment(lib“highgui210.lib“)
#pragma comment(lib“cxcore210.lib“)
HaarFeature::HaarFeature()
{
IntgData = NULL;
HaarVec = NULL;
imageSize.x=0;
imageSize.y=0;
FeatureLength = 0;
HaarFeatureLength =0;
}
HaarFeature::~HaarFeature()
{
ReleaseMemIntgImg();
ReleaseMemFeaVec();
}
bool HaarFeature::ReleaseMemIntgImg()
{
if(IntgData!=NULL)
{
free(IntgData);
IntgData=NULL;
}
return true;
}
bool HaarFeature::AllocMemIntgImg()
{
ReleaseMemIntgImg();
if(imageSize.x==0||imageSize.y==0)
return false;
IntgData = (double*)calloc(imageSize.x*imageSize.ysizeof(double));
return true;
}
bool HaarFeature::ReleaseMemFeaVec()
{
if(HaarVec!=NULL)
{
free(HaarVec);
HaarVec=NULL;
}
return true;
}
bool HaarFeature::AllocMemFeaVec()
{
ReleaseMemFeaVec();
if(HaarFeatureLength==0)
return false;
HaarVec = (double*)calloc(HaarFeatureLengthsizeof(double));
return true;
}
void HaarFeature::CalcIntgImg(IplImage *image)
{
AllocMemIntgImg();
double *pData = IntgData;
//转Gray
IplImage *imageGray = cvCreateImage(cvSize(image->widthimage->height)81);
if(image->nChannels==3)
cvCvtColor(imageimageGrayCV_BGR2GRAY);
else
cvCopy(imageimageGray);
///////第一行////
double count(0);
for(int i=0;i {
count += ((uchar*)(imageGray->imageData))[i];
*pData++ = count;
}
//////后面各行/////
double *pPreData;
for(int i=1;i {
pPreData = pData - imageSize.x;
count = 0;
for(int j=0;j {
count += ((uchar*)(imageGray->imageData + imageGray->widthStep*i))[j];
*pData++ = *pPreData++ + count;
}
}
cvReleaseImage(&imageGray);
}
/////////////////////////////////////////////////////////////////////////////////
void HaarFeature::GetFeatures()
{
GetFeatureLength();
AllocMemFeaVec();
double *pFeatures = HaarVec;
double *pInterData = IntgData;
int FeatureType;
POINT FeatureStPos FeatureScale;
long feaCount = 0;
FeatureStPos.y = 1;
while (FeatureStPos.y < imageSize.y-1)//行扫描
{
FeatureStPos.x = 1;
while (FeatureStPos.x < imageSize.x-1)//列扫描
{
//====== 计算A类特征 ======
FeatureScale.y = 2;
FeatureType = 0;
while (FeatureStPos.y + FeatureScale.y < imageSize.y)//特征y方向放大
{
FeatureScale.x = 2;
while (FeatureStPos.x + 2 * FeatureScale.x < imageSize.x)//特征x方向放大
{
pFeatures[feaCount] = GetOneFeatureValue(FeatureType FeatureStPos FeatureScalepInterData);
feaCount++;
FeatureScale.x ++;
}
FeatureScale.y ++;
}
//========= 计算B类特征 ==========
FeatureScale.y = 2;
FeatureType = 1;
while (FeatureStPos.y + 2 * FeatureScale.y < imageSize.y)//特征y方向放大
{
FeatureScale.x
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 13178 2015-07-24 15:06 HaarFeature.cpp
文件 1871 2015-11-04 17:56 HaarFeature.h
文件 15817 2015-07-29 10:42 HOG.cpp
文件 3348 2015-11-04 17:55 HOG.h
文件 29715 2015-07-21 14:34 LBP.CPP
文件 4025 2015-11-04 17:56 LBP.H
文件 9439 2015-07-22 10:11 MomentFeature.cpp
文件 2731 2015-11-04 17:55 MomentFeature.h
----------- --------- ---------- ----- ----
80124 8
相关资源
- Anti-biofilm Activity of Resveratrol and Ursol
- 佳能canon lbp3000激光打印机驱动 for w
- 一种基于LBP和CNN的人脸识别算法
- 3D_HOG 代码
- 软件工程——理论与实践中文翻译版
- hog特征提取,c版本代码
- 基于LBP算法的人脸识别研究
- LBPH人脸识别
- HOG+SVM实现数字识别
-
haarcascade_mcs_nose.xm
l - 人车分类识别 HOG特征+KNN分类器
-
ob
jectMarkerSetup.exe -
opencv haar检测训练成功xm
l -
haarcascades人脸特征分类器xm
l文件 - 基于HOG特征提取的svm行人头肩训练
- 关于人脸识别的9篇论文
- 经典的行人检测算法,利用HOG和SVM实
- 基于HOG-CSLBP与深度学习的跨年龄人脸
- LBP+直方图与PCA+的欧式距离的人脸识别
- haar-like特征提取
- 基于LBP的图像检索
- haar+Adaboost人脸检测viola-jones人脸检测
- 行人检测程序
- 佳能LBP2900驱动官方原版64位
- Fundamental Principles of Optical Lithography
- 蓝牙核心技术-HOGP
- 基于LBP的植物叶片识别
- opencv haartraining 合并.vec文件的工具
- HOG_SVM_DATA
-
haarcascade_mcs等所有识别xm
l文件
评论
共有 条评论