예제 #1
0
 internal ImageData(byte[] data, ColorInfo info)
 {
     FrameData   = data;
     Description = info;
 }
예제 #2
0
        internal NuiSensor(NuiApplication nuiApp, string name, string company, int id, SensorState state,
                           int colorFrameWidth, int colorFrameHeight, int colorbpp, int depthFrameWidth, int depthFrameHeight, int depthbpp, int maxTrackingbody)
        {
            this.ColorFrameAuthority = false;
            this.DepthFrameAuthority = false;
            this.BodyFrameAuthority  = false;

            this._app = nuiApp;

            this.Name   = name;
            this.Vendor = company;
            this.Id     = id;
            this.State  = state;


            bool EnableCoordinate = false;

            double JointDepthXMult   = 0;
            double JointDepthXFix    = 0;
            double JointDepthYMult   = 0;
            double JointDepthYFix    = 0;
            double DepthToJointZMult = 0;

            //나중엔 uID 로 처리하던가 해야함.
            switch (name)
            {
            case "Kinect":
                EnableCoordinate = true;

                JointDepthXMult   = 1.85;
                JointDepthXFix    = 0;
                JointDepthYMult   = 1.9;
                JointDepthYFix    = 0.13;
                DepthToJointZMult = 0.00123;
                break;

            case "Kinect2":
                EnableCoordinate = true;

                JointDepthXMult   = 1.5;
                JointDepthXFix    = 0;
                JointDepthYMult   = 1.45;
                JointDepthYFix    = 0.085;
                DepthToJointZMult = 0.00107;
                break;
            }

            ColorInfo = new ColorInfo(colorFrameWidth, colorFrameHeight, colorbpp);

            if (EnableCoordinate)
            {
                DepthInfo = new DepthInfo(depthFrameWidth, depthFrameHeight, short.MinValue, short.MaxValue, depthbpp,
                                          EnableCoordinate,
                                          JointDepthXMult, JointDepthXFix, JointDepthYMult, JointDepthYFix,
                                          DepthToJointZMult);
            }
            else
            {
                DepthInfo = new DepthInfo(depthFrameWidth, depthFrameHeight, short.MinValue, short.MaxValue, depthbpp);
            }

            BodyInfo = new BodyInfo(maxTrackingbody);
        }