资源简介
我使用OpenCV2.4.4的windows版本+Qt4.8.3+VS2010的编译器做了一个手势识别的小程序。
本程序主要使到了Opencv的特征训练库和最基本的图像处理的知识,包括肤色检测等等。
废话不多,先看一下基本的界面设计,以及主要功能:
代码片段和文件信息
#include “handgesturedialog.h“
#include “ui_handgesturedialog.h“
#include
HandGestureDialog::HandGestureDialog(QWidget *parent) :
QDialog(parent)
ui(new Ui::HandGestureDialog)
{
ui->setupUi(this);
cam = NULL;
frame = NULL;
isRun = 1;
time_intervals = 100;
timer = new QTimer(this);
imag = new QImage();
gesturecount = 0;
status_switch = Nothing;
pt = NULL;
r = 0;
afterSkin = NULL;
connect(timer SIGNAL(timeout()) this SLOT(readFarme()));
ui->pushButton_CloseCamera->setDisabled (true);
ui->pushButton_ShowPause->setDisabled (true);
ui->pushButton_SnapImage->setDisabled (true);
}
HandGestureDialog::~HandGestureDialog()
{
delete ui;
}
void HandGestureDialog::StartRecongizeHand (IplImage *img)
{
// Create a string that contains the exact cascade name
// Contains the trained classifer for detecting hand
const char *cascade_name=“hand.xml“;
// Create memory for calculations
static CvMemStorage* storage = 0;
// Create a new Haar classifier
static CvHaarClassifierCascade* cascade = 0;
// Sets the scale with which the rectangle is drawn with
int scale = 1;
// Create two points to represent the hand locations
CvPoint pt1 pt2;
// Looping variable
int i;
// Load the HaarClassifierCascade
cascade = (CvHaarClassifierCascade*)cvLoad( cascade_name 0 0 0 );
// Check whether the cascade has loaded successfully. Else report and error and quit
if( !cascade )
{
fprintf( stderr “ERROR: Could not load classifier cascade\n“ );
return;
}
// Allocate the memory storage
storage = cvCreateMemStorage(0);
// Create a new named window with title: result
cvNamedWindow( “result“ 1 );
// Clear the memory storage which was used before
cvClearMemStorage( storage );
// Find whether the cascade is loaded to find the hands. If yes then:
if( cascade )
{
// There can be more than one hand in an image. So create a growable sequence of hands.
// Detect the objects and store them in the sequence
CvSeq* hands = cvHaarDetectobjects( img cascade storage
1.1 2 CV_HAAR_DO_CANNY_PRUNING
cvSize(40 40) );
// Loop the number of hands found.
for( i = 0; i < (hands ? hands->total : 0); i++ )
{
// Create a new rectangle for drawing the hand
CvRect* r = (CvRect*)cvGetSeqElem( hands i );
// Find the dimensions of the handand scale it if necessary
pt1.x = r->x*scale;
pt2.x = (r->x+r->width)*scale;
pt1.y = r->y*scale;
pt2.y = (r->y+r->height)*scale;
// Draw the rectangle in the input image
cvRectangle( img pt1 pt2 CV_RGB(23020232)
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2013-11-05 18:39 HandGesture\
文件 6093 2013-07-12 10:15 HandGesture\HandGesture.pro
文件 17435 2013-07-12 13:03 HandGesture\HandGesture.pro.user
文件 6433 2013-07-12 10:53 HandGesture\handgesturedialog.cpp
文件 1665 2013-07-12 10:33 HandGesture\handgesturedialog.h
文件 9569 2013-07-12 10:53 HandGesture\handgesturedialog.ui
目录 0 2013-11-05 18:40 HandGesture\InfoDoc\
文件 14143 2009-10-25 21:26 HandGesture\InfoDoc\gestureFeatureFile.yml
文件 79 2009-10-25 21:26 HandGesture\InfoDoc\gestureFile.txt
文件 72462 2011-11-29 14:19 HandGesture\InfoDoc\hand.xm
文件 350 2013-05-30 00:23 HandGesture\main.cpp
目录 0 2013-11-05 18:40 HandGesture\OthersDocument\
文件 9084 2013-06-01 09:48 HandGesture\OthersDocument\FaceDetection.cpp
目录 0 2013-11-05 18:40 HandGesture\OthersDocument\fingertips\
文件 4452 2011-01-12 17:18 HandGesture\OthersDocument\fingertips\fingertips.cpp
文件 9728 2010-12-01 09:14 HandGesture\OthersDocument\fingertips\fingertips.suo
目录 0 2013-11-05 18:40 HandGesture\OthersDocument\fingertips\images\
文件 41078 2010-11-26 16:34 HandGesture\OthersDocument\fingertips\images\down-000.bmp
文件 41078 2010-11-26 16:35 HandGesture\OthersDocument\fingertips\images\down-001.bmp
文件 41078 2010-11-26 16:34 HandGesture\OthersDocument\fingertips\images\left-000.bmp
文件 41078 2010-11-26 16:35 HandGesture\OthersDocument\fingertips\images\left-001.bmp
文件 41078 2010-11-26 16:34 HandGesture\OthersDocument\fingertips\images\right-000.bmp
文件 41078 2010-11-26 16:35 HandGesture\OthersDocument\fingertips\images\right-001.bmp
文件 41078 2010-11-26 16:34 HandGesture\OthersDocument\fingertips\images\straight-000.bmp
文件 41078 2010-11-26 16:35 HandGesture\OthersDocument\fingertips\images\straight-001.bmp
文件 41078 2010-11-26 16:34 HandGesture\OthersDocument\fingertips\images\up-000.bmp
文件 41078 2010-11-26 16:35 HandGesture\OthersDocument\fingertips\images\up-001.bmp
目录 0 2013-11-05 18:40 HandGesture\SRC\
文件 33249 2013-06-01 00:41 HandGesture\SRC\AIGesture.cpp
文件 2602 2013-05-30 14:32 HandGesture\SRC\AIGesture.h
文件 895 2013-05-28 11:34 HandGesture\SRC\GestrueInfo.cpp
............此处省略493个文件信息
- 上一篇:CST入门教程手把手教你如何设计仿真
- 下一篇:游戏策划案
相关资源
- ippicv_win(官方ippicv_windows_20141027版本
- opencv2.0.0安装包
- 利用Opencv3.2中的DPM模块,实现DPM算法
- OpenCV_1.0 安装包
- 中移M5311最全资料
- opencv3.4.1最新库文件
- UnityVR手势识别插件VR Infinite Gesture1.
- CMake编译opencv mingw版本
- 基于opencv的人脸检测与跟踪
- 摄像头寻迹+stm32平衡车
- OpenCV初学英文文献
- 基于opencv的远程视频监控智能小车
- OpenCV By Example (OpenCV3)
- 免费学习opencv中文版
- 基于OpenCV的张正有标定法代码+棋盘图
- OpenCV算法实现参考文献
- opencv3.4.1的opencv_traincascade.exe 和 open
- 车辆分车道计数
- 学习OpenCV3中文版实力源码
- VCOpenCV视频前景物体提取标出运动轨迹
- opencv_ffmpeg_64.dll
- opencv_ffmpeg.dll
- Hands-On GPU-Accelerated Computer Vision with
- opencv3.4.0
- opencv-4.0.0-windows版本
- ippicv_2019_win_intel64_20180723_general.7z
- k-means算法代码
- opencv使用cascade分类器训练人脸检测的
- 用于运动目标检测的视频。
- OpenCV 4.0.0 VS2017vc15编译后的lib、dll、
评论
共有 条评论