Example #1
0
        /// <summary>
        /// Raises the destroy event.
        /// </summary>
        void OnDestroy()
        {
            capture.release();

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

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

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

            #if UNITY_WEBGL && !UNITY_EDITOR
            foreach (var coroutine in coroutines)
            {
                StopCoroutine(coroutine);
                ((IDisposable)coroutine).Dispose();
            }
            #endif
        }
        /// <summary>
        /// Raises the destroy event.
        /// </summary>
        void OnDestroy()
        {
            capture.release();

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

            if (texture != null)
            {
                Texture2D.Destroy(texture);
                texture = null;
            }

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

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

            #if UNITY_WEBGL && !UNITY_EDITOR
            if (getFilePath_Coroutine != null)
            {
                StopCoroutine(getFilePath_Coroutine);
                ((IDisposable)getFilePath_Coroutine).Dispose();
            }
            #endif
        }
        /// <summary>
        /// Raises the destroy event.
        /// </summary>
        void OnDestroy()
        {
            if (sourceToMatHelper != null)
            {
                sourceToMatHelper.Dispose();
            }

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

            if (objects != null)
            {
                objects.Dispose();
            }
        }
        public void OnResetTrackerButton()
        {
            if (trackers != null)
            {
                trackers.Dispose();
                trackers = null;
            }
            if (objects != null)
            {
                objects.Dispose();
                objects = null;
            }

            trackers = new MultiTracker("KCF");
            objects  = new MatOfRect2d();
            trackingColorList.Clear();
            selectedPointList.Clear();
        }