资源简介
OPENCV动作识别--挥拳动作识别,OpenCV3.0版本,VS2012完美运行。
代码片段和文件信息
#include “afx.h“
#include // for standard I/O
#include // for strings
#include // for controlling float print precision
#include // string to number conversion
#include
#include “cv.h“
#include “highgui.h“
#include “cxcore.h“
#include // Gaussian Blur
#include // Basic OpenCV structures (cv::Mat Scalar)
#include // OpenCV window I/O
#include“opencv2/opencv.hpp“
using namespace cv;
using namespace std;
int main(int arg const char** argv)
{
int delay = 1;
char c;
int frameNum = -1; // frame counter
bool lastImgHasHand=false;
int previousX=0;
int previousY=0;
int pt=0;//显示help判断用
// CvCapture* pCapture = NULL;// /////////////////////////////////////////////////////////////////
// pCapture = cvCaptureFromCAM(-1); //////////////////////////////////////////////////////////////
//Size refS = Size( (int) captRefrnc.get(CV_CAP_PROP_frame_WIDTH)
// (int) captRefrnc.get(CV_CAP_PROP_frame_HEIGHT) );
bool bHandFlag = false;
//const char* WIN_SRC = “Source“;
const char* WIN_RESULT = “Result“;
// Windows
//namedWindow(WIN_SRC CV_WINDOW_AUTOSIZE );
namedWindow(WIN_RESULT CV_WINDOW_AUTOSIZE);
Mat frame; // 输入视频帧序列
Mat frameHSV; // hsv空间
Mat mask(frame.rows frame.cols CV_8UC1); // 2值掩膜
Mat dst(frame); // 输出图像
// Mat frameSplit[4];
vector< vector > contours; // 轮廓
vector< vector > filterContours; // 筛选后的轮廓
vector< Vec4i > hierarchy; // 轮廓的结构信息
vector< Point > hull; // 凸包络的点集
bool movement=false;
int count=0;
int presentX=0;
int presentY=0;
VideoCapture capture; ////////////////////////////////////////////////////////
capture.open(0);///////////////////////////////////////////////////
if(!capture.isOpened())
{
return 0;
}/////////////////////////////////////////////////////////////////////////////////
while(true) //Show the image captured in the window and repeat
{
//captRefrnc >> frame;
int minX=320;//屏幕的一半
int maxX=240;
int minY=320;
int maxY=240;
capture >> frame;//////////////////////////////////////////////////////////////
if( frame.empty())
{
cout << “ < < < Game over! > > > “<< endl;
break;
}
//imshow( WIN_SRC frame);//显示Source的图像
Mat ws=frame.clone();//////////////////////////////////////////////////////////////////
// Begin
// 中值滤波,去除椒盐噪声
medianBlur(frame frame 5);
cvtColor( frame frameHSV CV_BGR2HSV );
Mat dstTemp1(frame.rows frame.cols CV_8UC1);
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2018-05-16 14:35 test1\
目录 0 2018-05-14 15:50 test1\Debug\
文件 122880 2018-05-14 15:50 test1\Debug\test1.exe
文件 644000 2018-05-14 15:50 test1\Debug\test1.ilk
文件 3402752 2018-05-14 15:50 test1\Debug\test1.pdb
目录 0 2018-04-08 13:14 test1\test1\
目录 0 2018-05-14 15:50 test1\test1\Debug\
文件 43710 2018-05-14 15:50 test1\test1\Debug\CL.read.1.tlog
文件 280 2018-05-14 15:50 test1\test1\Debug\CL.write.1.tlog
文件 596 2018-05-14 15:50 test1\test1\Debug\cl.command.1.tlog
文件 2 2018-05-14 15:50 test1\test1\Debug\li
文件 2 2018-05-14 15:50 test1\test1\Debug\li
文件 2 2018-05-14 15:50 test1\test1\Debug\li
文件 2 2018-05-14 15:50 test1\test1\Debug\li
文件 2 2018-05-14 15:50 test1\test1\Debug\li
文件 2 2018-05-14 15:50 test1\test1\Debug\li
文件 2 2018-05-14 15:50 test1\test1\Debug\li
文件 2 2018-05-14 15:50 test1\test1\Debug\li
文件 2 2018-05-14 15:50 test1\test1\Debug\li
文件 2 2018-05-14 15:50 test1\test1\Debug\li
文件 2 2018-05-14 15:50 test1\test1\Debug\li
文件 2 2018-05-14 15:50 test1\test1\Debug\li
文件 2 2018-05-14 15:50 test1\test1\Debug\li
文件 2 2018-05-14 15:50 test1\test1\Debug\li
文件 2 2018-05-14 15:50 test1\test1\Debug\li
文件 2 2018-05-14 15:50 test1\test1\Debug\li
文件 2 2018-05-14 15:50 test1\test1\Debug\li
文件 2 2018-05-14 15:50 test1\test1\Debug\li
文件 2 2018-05-14 15:50 test1\test1\Debug\li
文件 2 2018-05-14 15:50 test1\test1\Debug\li
文件 2 2018-05-14 15:50 test1\test1\Debug\li
............此处省略24个文件信息
- 上一篇:非参数统计-吴喜之.pdf
- 下一篇:一个栩栩如生的桌面动画鱼
相关资源
- SIFT算法实现及代码详解239444
- 基于opencv与opengl实现增强现实
- 利用opencv实现疲劳检测
- QT+Opencv2+VS2012 使用多线程显示网络摄
- opencv3.4.1 编译库,可在Qt直接使用
- opencv3.4+contrib vs2017 debug x64 编译好的库
- VS+OPENCV+ZBAR一维,二维码识别[包含中
- 基于OpenCV的车牌识别
- OpenCV_world330.lib
- win32平台的opencv3.4.2
- OpenCV2.1安装包
- 深入理解OpenCV:实用计算机视觉项目
- 学习OpenCV(中文版)pdf文档+源码
- 学习opencv 中文版及源码
- opencv-3.3.1 for vs2013
- OpenCV3.2编译文件
- QtOpencvImageGUI
- OpenCV实现多目三维重建
- opencv2.4.13lib_x86_x64_vs2013
- 形状匹配find_scaled_shape_model
- OpenCV 3.3_x86_minGW_world
- Opencv-stitcher基本原理参考文献
- opencv调用海康威视摄像头源代码内大
- 配合单文档调用opencv的代码
- opencv SVM图分类训练图片和测试图片
- QT+opencv的图像处理
- HOG+Adaboost级联分类器训练代码
- VS+QT+Opencv可视化编程
- 最全的OpenCV源代码
- 基于Opencv的红外运动目标识别与跟踪
评论
共有 条评论