public static PXCMPointI32 GetTrackedPoint(PXCMBlobExtractor.BlobData blobData, BlobUtilityClass.TrackingBlobPoint blobPointToTrack)
		{
			PXCMPointI32 point = new PXCMPointI32();
			
			switch (blobPointToTrack)
			{
			case TrackingBlobPoint.BottomPoint:
				point = blobData.bottomPoint;
				break;
			case TrackingBlobPoint.TopPoint:
				point = blobData.topPoint;
				break;
			case TrackingBlobPoint.RightPoint:
				point = blobData.rightPoint;
				break;
			case TrackingBlobPoint.LeftPoint:
				point = blobData.leftPoint;
				break;
			case TrackingBlobPoint.CenterPoint:
				//converting to int
				point.x = (int)blobData.centerPoint.x;
				point.y = (int)blobData.centerPoint.y;
				break;
			case TrackingBlobPoint.ClosestPoint:
				point = blobData.closestPoint;
				break;
			}
			
			return point;
		}
        /// <summary>
        /// OnDisable - Make sure to release all SDK instances and alocated memory to avoid read access error
        /// </summary>
        void OnDisable()
        {
            if (m_blob != null)
            {
                m_blob.Dispose();
                m_blob = null;
            }

            if (m_contour != null)
            {
                m_contour.Dispose();
                m_contour = null;
            }
            if (sm != null)
            {
                sm.Close();
                sm.Dispose();
                sm = null;
            }
        }
Example #3
0
        void OnDisable()
        {
            //Disposses all modules

            Initialized = false;
            if (SenseManager == null)
            {
                return;
            }

            DisposeFunctions.ForEach(i => i.DynamicInvoke());

            if (FaceModuleOutput != null)
            {
                FaceModuleOutput.Dispose();
                FaceModuleOutput = null;
            }
            if (HandDataOutput != null)
            {
                SenseManager.PauseHand(true);
                HandDataOutput.Dispose();
                HandDataOutput = null;
            }
            if (ImageRgbOutput != null)
            {
                ImageRgbOutput.Dispose();
                ImageRgbOutput = null;
            }
            if (ImageDepthOutput != null)
            {
                ImageDepthOutput.Dispose();
                ImageDepthOutput = null;
            }

            if (ImageIROutput != null)
            {
                ImageIROutput.Dispose();
                ImageIROutput = null;
            }

            if (Image3DSegmentationOutput != null)
            {
                Image3DSegmentationOutput.Dispose();
                Image3DSegmentationOutput = null;
            }

            if (Projection != null)
            {
                Projection.Dispose();
                Projection = null;
            }

            if (BlobExtractor != null)
            {
                BlobExtractor.Dispose();
                BlobExtractor = null;
            }

            UvMap = null;

            PointCloud = null;

            SenseManager.Dispose();
            SenseManager = null;
        }
        void OnDisable()
        {
            //Disposses all modules

            Initialized = false;
            if (SenseManager == null) return;

            DisposeFunctions.ForEach( i=> i.DynamicInvoke());

            if (FaceModuleOutput != null)
            {
                FaceModuleOutput.Dispose();
                FaceModuleOutput = null;
            }
            if (HandDataOutput != null)
            {
                SenseManager.PauseHand(true);
                HandDataOutput.Dispose();
                HandDataOutput = null;
            }
            if (ImageRgbOutput != null)
            {
                ImageRgbOutput.Dispose();
                ImageRgbOutput = null;
            }
            if (ImageDepthOutput != null)
            {
                ImageDepthOutput.Dispose();
                ImageDepthOutput = null;
            }

            if (ImageIROutput != null)
            {
                ImageIROutput.Dispose();
                ImageIROutput = null;
            }

            if (Image3DSegmentationOutput != null)
            {
                Image3DSegmentationOutput.Dispose();
                Image3DSegmentationOutput = null;
            }

            if (Projection != null)
            {
                Projection.Dispose();
                Projection = null;
            }

            if (BlobExtractor != null)
            {
                BlobExtractor.Dispose();
                BlobExtractor = null;
            }

            UvMap = null;

            PointCloud = null;

            SenseManager.Dispose();
            SenseManager = null;
        }