资源简介
基于OpenCV+vs2008的手势检测,检测英文字母A的手势,利用了OpenCV的haar特征级联分类器,效果可好
代码片段和文件信息
/************************************************************************
* Copyright(c) 2011 Yang Xian
* All rights reserved.
*
* File: handGestureDetection.cpp
* Brief: 手势检测
* Version: 1.0
* Author: Yang Xian
* Email: xyang2011@sinano.ac.cn
* Date: 2011/12/01
* History:
************************************************************************/
#include
#include
#include
#include
#include
using namespace std;
using namespace cv;
/** Function Headers */
void detectAndDisplay( Mat frame );
/** Global variables */
String face_cascade_name = “hand.xml“;
CascadeClassifier CHandCascade;
string window_name = “Hand Gesture Detection“;
int main(int argc const char** argv)
{
Mat frame;
//-- 1. Load the cascades
if( !CHandCascade.load( face_cascade_name ) )
{
printf(“--(!)Error loading\n“);
return -1;
}
//-- 2. Read the video stream
CvCapture* capture = cvCaptureFromCAM( -1 );
// VideoCapture capture(“hand.avi“);
if(/*capture.isOpened()*/capture)
{
while( true )
{
frame = cvQueryframe( capture );
// capture >> frame;
//-- 3. Apply the classifier to the frame
if( !frame.empty() )
{
detectAndDisplay( frame );
}
else
{
printf(“ --(!) No captured frame -- Break!“);
break;
}
int c = waitKey(10);
if((char)c == 27)
{
break;
}
}
}
return 0;
}
/**
* @function detectAndDisplay
*/
void detectAndDisplay( Mat frame )
{
std::vector hands;
Mat frame_gray;
cvtColor( frame frame_gray CV_BGR2GRAY );
equalizeHist( frame_gray frame_gray );
//-- Detect faces
CHandCascade.detectMultiScale(frame_gray hands 1.1 2 CV_HAAR_DO_CANNY_PRUNING Size(40 40));
for(size_t i=0; i {
rectangle(frame hands[i] Scalar(2550255));
}
//-- Show what you got
imshow( window_name frame );
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 72462 2011-11-29 14:19 handGestureDetection\Debug\hand.xm
文件 57856 2011-12-03 09:00 handGestureDetection\Debug\handGestureDetection.exe
文件 446680 2011-12-03 09:00 handGestureDetection\Debug\handGestureDetection.ilk
文件 4885504 2011-12-03 09:00 handGestureDetection\Debug\handGestureDetection.pdb
文件 6632 2011-12-03 09:00 handGestureDetection\handGestureDetection\Debug\BuildLog.htm
文件 621 2011-12-03 09:00 handGestureDetection\handGestureDetection\Debug\handGestureDetection.exe.intermediate.manifest
文件 130533 2011-12-03 09:00 handGestureDetection\handGestureDetection\Debug\handGestureDetection.obj
文件 67 2011-12-03 09:00 handGestureDetection\handGestureDetection\Debug\mt.dep
文件 404480 2011-12-03 09:00 handGestureDetection\handGestureDetection\Debug\vc90.idb
文件 700416 2011-12-03 09:00 handGestureDetection\handGestureDetection\Debug\vc90.pdb
文件 5395040 2011-10-28 08:19 handGestureDetection\handGestureDetection\hand.AVI
文件 72462 2011-11-29 14:19 handGestureDetection\handGestureDetection\hand.xm
文件 2036 2011-12-03 09:00 handGestureDetection\handGestureDetection\handGestureDetection.cpp
文件 3803 2011-12-03 08:59 handGestureDetection\handGestureDetection\handGestureDetection.vcproj
文件 1423 2011-12-03 09:17 handGestureDetection\handGestureDetection\handGestureDetection.vcproj.HP98402794308.Administrator.user
文件 5778432 2011-12-03 09:17 handGestureDetection\handGestureDetection.ncb
文件 926 2011-12-01 14:00 handGestureDetection\handGestureDetection.sln
..A..H. 9216 2011-12-03 09:17 handGestureDetection\handGestureDetection.suo
目录 0 2011-12-03 09:00 handGestureDetection\handGestureDetection\Debug
目录 0 2011-12-03 09:06 handGestureDetection\Debug
目录 0 2011-12-03 09:00 handGestureDetection\handGestureDetection
目录 0 2011-12-01 15:49 handGestureDetection
----------- --------- ---------- ----- ----
17968589 22
- 上一篇:ios 11.4 真机调试包
- 下一篇:OpenCV实现同一窗口显示多幅图片
相关资源
-
haartraining+ob
jectmarker,opencv,Adaboo - opencv车辆检测model
-
opencvHaar特征进行的分类器-所有xm
- Vehicle-And-Pedestrian-Detection-Using-Haar-Ca
- 基于HAAR特征SVM分类器训练模型,包含
- HOG+Adaboost级联分类器训练代码
- OpenCV级联分类器训练与使用教程与代
- 提取图像的haar特征5个方向并将其保存
- train800.rar
- 自习室查找app
- 图片随手势缩放平移,多点触控
- opencv_haartraining等可执行文件
- 通过摄像头采集图像进行手势检测
-
haarcascades 各种分类器xm
l文件训练好
评论
共有 条评论