• 大小: 1.6MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-09-01
  • 语言: 其他
  • 标签: 手指检测  

资源简介

KinectSDK2.0手指检测判断,完成相应识别操作,判断手指是否进行操作

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Emgu.CV.Structure;
using Emgu.CV;
using Microsoft.Kinect;
using System.Collections;

namespace HandGestureRecognition
{
    public partial class MainWindow : Form
    {
        private const Int32 MAX_INT32 = Int32.MaxValue;
        Image currentframe;
        Image movement;
        Image colorframe;
        MouseDriver mouse;
        ArrayList touchPoints;

        int frameWidth;
        int frameHeight;
        int cropWidth;
        int cropHeight;
        private short[] tableData;
        private short[] pixelData;
        private short[] pixelDataLast;
        private byte[] depthframe32;
        bool recalibrate;

        int thickness;

        Seq hull;
        Seq filteredHull;
        Seq defects;
        MCvConvexityDefect[] defectArray;
        MCvBox2D box;

        Seq dPointList; // All the end points on the contour
        Seq realendPointList; // All the end points on the contour

        public MainWindow()
        {
            InitializeComponent();
            box = new MCvBox2D();
            mouse = new MouseDriver();
            touchPoints = new ArrayList();
            thickness = 100;
            cropWidth = 480;
            cropHeight = 360;
            recalibrate = true;
            // show status for each sensor that is found now.
            foreach (KinectSensor kinect in KinectSensor.KinectSensors)
            {
                kinect.DepthStream.Enable(DepthImageFormat.Resolution640x480Fps30);
                kinect.DepthStream.Range = (DepthRange)1;
                kinect.Start();
                kinect.DepthframeReady += new EventHandlerameReadyEventArgs>(DepthImageReady);
            }
        }

        private void calibrate(DepthImageframe cal)
        {
            tableData = new short[cal.PixelDataLength];
            cal.CopyPixelDataTo(this.tableData);
        }

        void DepthImageReady(object sender DepthImageframeReadyEventArgs e)
        {
            using (DepthImageframe imageframe = e.OpenDepthImageframe())
            {
                if (imageframe != null)
                {
                    if (pixelData == null)
                    {
                        frameWidth = imageframe.Width;
                        frameHeight = imageframe.Height;
                        pixelData = new short[imageframe.PixelDataLength];
                        depthframe32 = new byte[frameWidth * frameHeight * 4];
                        currentframe = new Image(cropWidth cropHeight new Gray(0));
                        movement = new Image(cropWidth cropHeight new Gray(0));
                        pixelDataLast = new short[imageframe.PixelDataLength];
                    }
           

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2012-04-09 03:19  kinect-finger-tracking-master\
     文件        1624  2012-04-09 03:19  kinect-finger-tracking-master\HandGestureRecognition.sln
     目录           0  2012-04-09 03:19  kinect-finger-tracking-master\HandGestureRecognition\
     文件        7131  2012-04-09 03:19  kinect-finger-tracking-master\HandGestureRecognition\Form1.Designer.cs
     文件       13736  2012-04-09 03:19  kinect-finger-tracking-master\HandGestureRecognition\Form1.cs
     文件        6261  2012-04-09 03:19  kinect-finger-tracking-master\HandGestureRecognition\Form1.resx
     文件        9595  2012-04-09 03:19  kinect-finger-tracking-master\HandGestureRecognition\HandGestureRecognition.csproj
     文件       11322  2012-04-09 03:19  kinect-finger-tracking-master\HandGestureRecognition\MouseDriver.cs
     文件       36864  2012-04-09 03:19  kinect-finger-tracking-master\HandGestureRecognition\MouseKeyboardActivityMonitor.dll
     文件         498  2012-04-09 03:19  kinect-finger-tracking-master\HandGestureRecognition\Program.cs
     目录           0  2012-04-09 03:19  kinect-finger-tracking-master\HandGestureRecognition\Properties\
     文件        1438  2012-04-09 03:19  kinect-finger-tracking-master\HandGestureRecognition\Properties\AssemblyInfo.cs
     文件        2807  2012-04-09 03:19  kinect-finger-tracking-master\HandGestureRecognition\Properties\Resources.Designer.cs
     文件        5496  2012-04-09 03:19  kinect-finger-tracking-master\HandGestureRecognition\Properties\Resources.resx
     文件        1077  2012-04-09 03:19  kinect-finger-tracking-master\HandGestureRecognition\Properties\Settings.Designer.cs
     文件         242  2012-04-09 03:19  kinect-finger-tracking-master\HandGestureRecognition\Properties\Settings.settings
     文件        2148  2012-04-09 03:19  kinect-finger-tracking-master\HandGestureRecognition\SyntheticData.cs
     文件         227  2012-04-09 03:19  kinect-finger-tracking-master\HandGestureRecognition\app.config
     文件      243200  2012-04-09 03:19  kinect-finger-tracking-master\HandGestureRecognition\cvextern.dll
     文件     1715200  2012-04-09 03:19  kinect-finger-tracking-master\HandGestureRecognition\opencv_core231.dll
     文件     1629696  2012-04-09 03:19  kinect-finger-tracking-master\HandGestureRecognition\opencv_imgproc231.dll
     文件      285184  2012-04-09 03:19  kinect-finger-tracking-master\HandGestureRecognition\opencv_video231.dll
     目录           0  2012-04-09 03:19  kinect-finger-tracking-master\emgu_dlls\
     文件      126976  2012-04-09 03:19  kinect-finger-tracking-master\emgu_dlls\Emgu.CV.UI.dll
     文件      266240  2012-04-09 03:19  kinect-finger-tracking-master\emgu_dlls\Emgu.CV.dll
     文件       32768  2012-04-09 03:19  kinect-finger-tracking-master\emgu_dlls\Emgu.Util.dll

评论

共有 条评论

相关资源