• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# CameraSpacePoint类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中CameraSpacePoint的典型用法代码示例。如果您正苦于以下问题:C# CameraSpacePoint类的具体用法?C# CameraSpacePoint怎么用?C# CameraSpacePoint使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



CameraSpacePoint类属于命名空间,在下文中一共展示了CameraSpacePoint类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: GetHighestValidPointIndexInRectangle

        public static int GetHighestValidPointIndexInRectangle(int bIndex, int cIndex)
        {
            Point pB = GetPoint(bIndex);
            Point pC = GetPoint(cIndex);
            int rectangleWidth = pB.X - pC.X;

            CameraSpacePoint highestPoint = new CameraSpacePoint()
            {
                X = float.PositiveInfinity,
                Y = float.PositiveInfinity,
                Z = float.PositiveInfinity
            };

            int highestPointIndex = -1;

            for (int i = 0; i < rectangleWidth; i++)
            {
                for (int j = 0; j < rectangleWidth; j++)
                {
                    int currentIndex = GetIndex(pC.X + j, pB.Y + i);
                    if (BoundaryCheck(currentIndex))
                    {
                        CameraSpacePoint currentPoint = GlobVar.SubtractedFilteredPointCloud[currentIndex];

                        if (currentPoint.Z < highestPoint.Z && !float.IsInfinity(currentPoint.X) && !float.IsInfinity(currentPoint.Y))
                        {
                            highestPoint = currentPoint;
                            highestPointIndex = currentIndex;
                        }
                    }
                }
            }
            return highestPointIndex;
        }
开发者ID:leiferikbjorkli,项目名称:Kinect2TrackingTopView,代码行数:34,代码来源:GlobUtils.cs


示例2: GetEuclideanDistance

        public static float GetEuclideanDistance(CameraSpacePoint a, CameraSpacePoint b)
        {
            float distance =
                (float)Math.Sqrt((a.X - b.X) * (a.X - b.X) + (a.Y - b.Y) * (a.Y - b.Y) + (a.Z - b.Z) * (a.Z - b.Z));

            return float.IsNaN(distance) ? float.MaxValue : distance;
        }
开发者ID:leiferikbjorkli,项目名称:Kinect2TrackingTopView,代码行数:7,代码来源:GlobUtils.cs


示例3: CalculateIntensityFromCameraSpacePoints

        /// <summary>
        ///  Normalizes the depths in the input frame into a 0-255 byte gray-value array.
        /// </summary>
        public static byte[] CalculateIntensityFromCameraSpacePoints(CameraSpacePoint[] cameraSpacePoint)
        {
            var intensityMap = new byte[cameraSpacePoint.Length];

            for (int i = 0; i < cameraSpacePoint.Length; i++)
            {
                float depth = cameraSpacePoint[i].Z;
                if (depth != 0)
                {
                    float currentMax = depth - GlobVar.MinSensingDepth;
                    const float currentDepthRange = GlobVar.MaxSensingDepth - GlobVar.MinSensingDepth;

                    if (depth < GlobVar.MaxSensingDepth && depth > GlobVar.MinSensingDepth)
                    {
                        intensityMap[i] = (byte)(255 - (255 * currentMax / currentDepthRange));
                    }
                    else
                    {
                        intensityMap[i] = (byte)0;
                    }
                }
                else
                {
                    intensityMap[i] = (byte)0;
                }
            }
            return intensityMap;
        }
开发者ID:leiferikbjorkli,项目名称:Kinect2TrackingTopView,代码行数:31,代码来源:ImageUtils.cs


示例4: CreateIntegralImage

        private static float[] CreateIntegralImage(CameraSpacePoint[] cameraSpacePoints)
        {
            float[] integralImage = new float[GlobVar.ScaledFrameLength];
            for (var i = 0; i < GlobVar.ScaledFrameHeight; i++)
            {
                for (var j = 0; j < GlobVar.ScaledFrameWidth; j++)
                {
                    int indexCurrent = i * GlobVar.ScaledFrameWidth + j;
                    int indexUpLeft = (i - 1) * GlobVar.ScaledFrameWidth + j - 1;
                    int indexUp = (i - 1) * GlobVar.ScaledFrameWidth + j;
                    int indexLeft = i * GlobVar.ScaledFrameWidth + j - 1;

                    if (i==0 && j==0)
                    {
                        integralImage[indexCurrent] = cameraSpacePoints[indexCurrent].Z;
                    }
                    else if (i==0)
                    {
                        integralImage[indexCurrent] = cameraSpacePoints[indexCurrent].Z + integralImage[indexLeft];
                    }
                    else if (j == 0)
                    {
                        integralImage[indexCurrent] = cameraSpacePoints[indexCurrent].Z + integralImage[indexUp];
                    }
                    else
                    {
                        integralImage[indexCurrent] = cameraSpacePoints[indexCurrent].Z + integralImage[indexUp] + integralImage[indexLeft] - integralImage[indexUpLeft];
                    }
                }
            }
            return integralImage;
        }
开发者ID:leiferikbjorkli,项目名称:Kinect2TrackingTopView,代码行数:32,代码来源:HaarDetector.cs


示例5: CheckActiveWorkspace

 public void CheckActiveWorkspace(CameraSpacePoint[] handPositions)
 {
     if (handPositions.Length > 0)
     {
         CheckActiveWorkspace(Converter.CameraSpacePointsToPoint3Ds(handPositions).ToArray());
     }
 }
开发者ID:frksptr,项目名称:kinect-demo,代码行数:7,代码来源:RoomPointCloudView.xaml.cs


示例6: CameraSpacePointsToPoint3Ds

        public static List<Point3D> CameraSpacePointsToPoint3Ds(CameraSpacePoint[] cameraSpacePoints)
        {
            if (cameraSpacePoints == null)
            {
                return null;
            }
            if (cameraSpacePoints.Length == 0)
            {
                return null;
            }
            List<Point3D> point3Ds = new List<Point3D>();

            foreach (CameraSpacePoint point in cameraSpacePoints)
            {
                if (GeometryHelper.IsValidPoint(point))
                {
                    point3Ds.Add(new Point3D
                    {
                        X = point.X,
                        Y = point.Y,
                        Z = point.Z
                    });
                }
            }

            return point3Ds;
        }
开发者ID:frksptr,项目名称:kinect-demo,代码行数:27,代码来源:Converter.cs


示例7: Angle

        /// <summary>
        /// Calculates the angle between the specified points around the specified axis.
        /// </summary>
        /// <param name="center">The center of the angle.</param>
        /// <param name="start">The start of the angle.</param>
        /// <param name="end">The end of the angle.</param>
        /// <param name="axis">The axis around which the angle is calculated.</param>
        /// <returns>The angle, in degrees.</returns>
        public static double Angle(this CameraSpacePoint center, CameraSpacePoint start, CameraSpacePoint end, Axis axis)
        {
            switch (axis)
            {
                case Axis.X:
                    start.X = 0f;
                    center.X = 0f;
                    end.X = 0f;
                    break;
                case Axis.Y:
                    start.Y = 0f;
                    center.Y = 0f;
                    end.Y = 0f;
                    break;
                case Axis.Z:
                    start.Z = 0f;
                    center.Z = 0f;
                    end.Z = 0f;
                    break;
            }

            Vector3D first = start.ToVector3() - center.ToVector3();
            Vector3D second = end.ToVector3() - center.ToVector3();

            return Vector3D.AngleBetween(first, second);
        }
开发者ID:reeonce,项目名称:Vitruvius,代码行数:34,代码来源:MathExtensions.cs


示例8: Filter

        public CameraSpacePoint Filter(CameraSpacePoint point)
        {
            if (this.lastTrend == null || this.lastOutput == null)
            {
                this.lastTrend = point;
                this.lastOutput = point;
                return point;
            }

            var newTrend = new CameraSpacePoint
            {
                X = gamma * (point.X - lastOutput.Value.X) + (1 - gamma) * lastTrend.Value.X,
                Y = gamma * (point.Y - lastOutput.Value.Y) + (1 - gamma) * lastTrend.Value.Y,
                Z = gamma * (point.Z - lastOutput.Value.Z) + (1 - gamma) * lastTrend.Value.Z
            };

            var newOutput = new CameraSpacePoint
            {
                X = alpha * point.X + (1 - alpha) * (lastOutput.Value.X + lastTrend.Value.X),
                Y = alpha * point.Y + (1 - alpha) * (lastOutput.Value.Y + lastTrend.Value.Y),
                Z = alpha * point.Z + (1 - alpha) * (lastOutput.Value.Z + lastTrend.Value.Z)
            };

            this.lastTrend = newTrend;
            this.lastOutput = newOutput;
            return newOutput;
        }
开发者ID:primarilysoftware,项目名称:kinect-cursor,代码行数:27,代码来源:DoubleExponentialSmoothingFilter.cs


示例9: Distance

 /// <summary>
 /// Returns the length of the segment defined by the specified points.
 /// </summary>
 /// <param name="p1">The first point (start of the segment).</param>
 /// <param name="p2">The second point (end of the segment).</param>
 /// <returns>The length of the segment in meters.</returns>
 public static double Distance(CameraSpacePoint p1, CameraSpacePoint p2)
 {
     return Math.Sqrt(
         Math.Pow(p1.X - p2.X, 2) +
         Math.Pow(p1.Y - p2.Y, 2) +
         Math.Pow(p1.Z - p2.Z, 2));
 }
开发者ID:etrigger,项目名称:Vitruvius,代码行数:13,代码来源:CameraExtensions.cs


示例10: SetValues

 private void SetValues(CameraSpacePoint hand)
 {
     KinectX = hand.X;
     KinectY = hand.Y;
     ScreenX = (MaxValue / 2) + (KinectX * MaxValue);
     ScreenY = (MaxValue / 2) - (KinectY * MaxValue);
 }
开发者ID:jansaris,项目名称:KinectV2,代码行数:7,代码来源:HandTracker.cs


示例11: CustomJoint

 /// <summary>
 /// Create a new <c>CustomJoint</c> object based on the supplied
 /// <c>JointType</c> value.
 /// </summary>
 public CustomJoint(JointType type)
 {
     _jointType = type;
     _position = new CameraSpacePoint();
     _depthPosition = new DepthSpacePoint();
     _colorPosition = new ColorSpacePoint();
     _trackingState = TrackingState.NotTracked;
 }
开发者ID:douglaswinstonr,项目名称:KinectDL,代码行数:12,代码来源:CustomJoint.cs


示例12: CopyPosition

 private static CameraSpacePoint CopyPosition(CameraSpacePoint position)
 {
     CameraSpacePoint result = new CameraSpacePoint();
     result.X = position.X;
     result.Y = position.Y;
     result.Z = position.Z;
     return result;
 }
开发者ID:rachelriv,项目名称:Instrumovement,代码行数:8,代码来源:JointRecords.cs


示例13: CameraSpacePointToPoint3D

 public static Point3D CameraSpacePointToPoint3D(CameraSpacePoint cameraSpacePoint)
 {
     return new Point3D
     {
         X = cameraSpacePoint.X,
         Y = cameraSpacePoint.Y,
         Z = cameraSpacePoint.Z
     };
 }
开发者ID:frksptr,项目名称:kinect-demo,代码行数:9,代码来源:Converter.cs


示例14: SubstractPoints

        private static CameraSpacePoint SubstractPoints(CameraSpacePoint position1, CameraSpacePoint position2)
        {
            CameraSpacePoint result = new CameraSpacePoint();
            result.X = position1.X - position2.X;
            result.Y = position1.Y - position2.Y;
            result.Z = position1.Z - position2.Z;
            return result;

        }
开发者ID:rachelriv,项目名称:Instrumovement,代码行数:9,代码来源:VelocityComputer.cs


示例15: DistanceBetweenPoints

        private static double DistanceBetweenPoints(CameraSpacePoint point1, CameraSpacePoint point2)
        {
            double dx = Math.Abs(point2.X - point1.X);
            double dy = Math.Abs(point2.Y - point1.Y);

            double dz = Math.Abs(point2.Z - point1.Z);

            return Math.Sqrt(dx * dx + dy * dy + dz * dz);
        }
开发者ID:rachelriv,项目名称:Instrumovement,代码行数:9,代码来源:VelocityComputer.cs


示例16: getEinsvektor

        /*  Depricated  */
        public static CameraSpacePoint getEinsvektor(CameraSpacePoint point)
        {
            var e = (float)Math.Sqrt(Math.Pow(point.X, 2) + Math.Pow(point.Y, 2) + Math.Pow(point.Z, 2));
            point.X = point.X / e;
            point.Y = point.Y / e;
            point.Z = point.Z / e; 

            return point;
        }
开发者ID:madingo87,项目名称:netica,代码行数:10,代码来源:Helper.cs


示例17: Copy

        /// <summary>
        /// Copies camera space points from face to the gpu
        /// </summary>
        /// <param name="context"></param>
        /// <param name="points"></param>
        public void Copy(DeviceContext context, CameraSpacePoint[] points)
        {
            if (points.Length == 0)
                return;

            fixed (CameraSpacePoint* cptr = &points[0])
            {
                this.buffer.Upload(context, new IntPtr(cptr), points.Length * 12);
            }
        }
开发者ID:semihguresci,项目名称:kgp,代码行数:15,代码来源:DynamicHdFaceStructuredBuffer.cs


示例18: AddFrame

        public void AddFrame(CameraSpacePoint[] newFrame)
        {
            _temporalFrames.Add(_frameCounter,newFrame);
            _frameCounter++;

            if (_frameCounter == _maxTemporalFrames)
            {
                CalculateTemporalMedianImage();
            }
        }
开发者ID:leiferikbjorkli,项目名称:Kinect2TrackingTopView,代码行数:10,代码来源:TemporalMedianImage.cs


示例19: CSVectorSubtract

        CameraSpacePoint CSVectorSubtract(CameraSpacePoint p1, CameraSpacePoint p2)
        {
            CameraSpacePoint diff = new CameraSpacePoint();

            diff.X = p1.X - p2.X;
            diff.Y = p1.Y - p2.Y;
            diff.Z = p1.Z - p2.Z;

            return diff;
        }
开发者ID:njpanzarino,项目名称:Kinect,代码行数:10,代码来源:AnchorPointFilter.cs


示例20: Head

 public Head(int highestPointIndex)
 {
     HighestPointIndex = highestPointIndex;
     AvgCenterPoint = new CameraSpacePoint()
     {
         X = float.NaN,
         Y = float.NaN,
         Z = float.NaN
     };
 }
开发者ID:leiferikbjorkli,项目名称:Kinect2TrackingTopView,代码行数:10,代码来源:Head.cs



注:本文中的CameraSpacePoint类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# CameraState类代码示例发布时间:2022-05-24
下一篇:
C# CameraOperationCompletedEventArgs类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap