资源简介
opencv 飞行游戏手势控制源码。飞行游戏手势控制。。。。
代码片段和文件信息
#include “CVobject.h“
//Download by http://www.NewXing.com
#include
#include
#include
using namespace std;
void cvThresholdBidirection(IplImage* imgint lowerint upper)
{
assert(img->nChannels==1);
for (int h=0;hheight;h++){
for (int w=0;wwidth;w++){
unsigned char* p =(unsigned char*)(img->imageData+h*img->widthStep+w);
if (*p<=upper&&*p>=lower){
*p=255;
}else{
*p=0;
}
}
}
}
void cvFindTargets(const IplImage* img_const int erea_thresholdCvTarget &targets)
{
assert(img_->nChannels==1);
IplImage* img=cvCreateImage(cvSize(img_->widthimg_->height)IPL_DEPTH_8U1);
cvCopy(img_img);
CvTarget tar;
for (int h=0;hheight;h++){
for (int w=0;wwidth;w++){
if (*(unsigned char*)(img->imageData+h*img->widthStep+w)==255){
CvTarget target;
target.top=h;
target.bottom=h;
target.left=w;
target.right=w;
queue points;
points.push(cvPoint(wh));
*(img->imageData+h*img->widthStep+w)=0;
//find target with breadth iteration
while(!points.empty()){
target.erea++;
CvPoint p=points.front();
points.pop();
if (p.x>0&&*(unsigned char*)(img->imageData+p.y*img->widthStep+p.x-1)==255){//left
*(img->imageData+p.y*img->widthStep+p.x-1)=0;
points.push(cvPoint(p.x-1p.y));
if (target.left>p.x-1){
target.left=p.x-1;
}
}
if (p.y+1height&&*(unsigned char*)(img->imageData+(p.y+1)*img->widthStep+p.x)==255){//bottom
*(img->imageData+(p.y+1)*img->widthStep+p.x)=0;
points.push(cvPoint(p.xp.y+1));
if (target.bottom target.bottom=p.y+1;
}
}
if (p.x+1width&&*(unsigned char*)(img->imageData+p.y*img->widthStep+p.x+1)==255){//right
*(img->imageData+p.y*img->widthStep+p.x+1)=0;
points.push(cvPoint(p.x+1p.y));
if (target.right target.right=p.x+1;
}
}
if (p.y>0&&*(unsigned char*)(img->imageData+(p.y-1)*img->widthStep+p.x)==255){//top
*(img->imageData+(p.y-1)*img->widthStep+p.x)=0;
points.push(cvPoint(p.xp.y-1));
}
}
if (target.erea>erea_threshold){
if (target.erea>tar.erea){
tar=target;
}
}
}
}
}
targets=tar;
cvReleaseImage(&img);
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 41078 2010-11-26 16:34 www.NewXing.com\samples\down-000.bmp
文件 41078 2010-11-26 16:35 www.NewXing.com\samples\down-001.bmp
文件 41078 2010-11-26 16:35 www.NewXing.com\samples\down-002.bmp
文件 41078 2010-11-26 16:35 www.NewXing.com\samples\down-003.bmp
文件 41078 2010-11-26 16:35 www.NewXing.com\samples\down-004.bmp
文件 41078 2010-11-26 16:35 www.NewXing.com\samples\down-005.bmp
文件 41078 2010-11-26 16:36 www.NewXing.com\samples\down-006.bmp
文件 41078 2010-11-26 16:36 www.NewXing.com\samples\down-007.bmp
文件 41078 2010-11-26 16:36 www.NewXing.com\samples\down-008.bmp
文件 41078 2010-11-26 16:36 www.NewXing.com\samples\down-009.bmp
文件 41078 2010-11-26 16:36 www.NewXing.com\samples\down-010.bmp
文件 41078 2010-11-26 16:36 www.NewXing.com\samples\down-011.bmp
文件 41078 2010-11-26 16:36 www.NewXing.com\samples\down-012.bmp
文件 41078 2010-11-26 16:36 www.NewXing.com\samples\down-013.bmp
文件 41078 2010-11-26 16:37 www.NewXing.com\samples\down-014.bmp
文件 41078 2010-11-26 16:37 www.NewXing.com\samples\down-015.bmp
文件 41078 2010-11-26 16:37 www.NewXing.com\samples\down-016.bmp
文件 41078 2010-11-26 16:37 www.NewXing.com\samples\down-017.bmp
文件 41078 2010-11-26 16:37 www.NewXing.com\samples\down-018.bmp
文件 41078 2010-11-26 16:37 www.NewXing.com\samples\down-019.bmp
文件 41078 2010-11-26 16:38 www.NewXing.com\samples\down-020.bmp
文件 41078 2010-11-26 16:38 www.NewXing.com\samples\down-021.bmp
文件 41078 2010-11-26 16:38 www.NewXing.com\samples\down-022.bmp
文件 41078 2010-11-26 16:38 www.NewXing.com\samples\down-023.bmp
文件 41078 2010-11-26 16:38 www.NewXing.com\samples\down-024.bmp
文件 41078 2010-11-26 16:38 www.NewXing.com\samples\down-025.bmp
文件 41078 2010-11-26 16:38 www.NewXing.com\samples\down-026.bmp
文件 41078 2010-11-26 16:38 www.NewXing.com\samples\down-027.bmp
文件 41078 2010-11-26 16:39 www.NewXing.com\samples\down-028.bmp
文件 41078 2010-11-26 16:39 www.NewXing.com\samples\down-029.bmp
............此处省略186个文件信息
相关资源
- Qt+Opencv实现四步相移
- 相机标定棋盘图
- Opencv实战项目
- opencv.txt
- 利用Opencv较高效率的视频图像传输
- opencv人脸识别源码
- libopencv_core300.dll
- 坦克大战地图生成代码
- opencv_imgproc249d.dll
- opencv_highgui249d.dll
- 高级形态学变换
- opencv.rar
- FCN模型实现图像分割配套资料分享.
- 用于车牌识别的字符模板,数字,字
- OpenCVForUnity
- opencv 3.1.0 自带例程介绍
- OpenCV3.3百度云链接
- OpenCV-2.4.3百度网盘地址
- SURF、SIFT、ORB特征提取opencv程序
- 图像识别检测人数
- 获取连通域(可根据面积筛选封闭图
- opencv头文件以兹互勉
- 视频车辆识别
- 利用QT5.8与opencv3.2做的照片融合
- 基于opencv的retinex单尺度实现
- Opencv人脸分类器训练以及人脸识别全
- opencv 鼠标框选 跟踪
- 图像识别(13)——手势识别(1)—
- convert_cascade
- boostdesc_bgm_hd.i
评论
共有 条评论