Beispiel #1
0
        /// <summary>
        /// Raises the destroy event.
        /// </summary>
        void OnDestroy()
        {
            if (faceMaskColorCorrector != null)
            {
                faceMaskColorCorrector.Dispose();
            }

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

            if (cascade != null)
            {
                cascade.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()
        {
            if (faceMaskColorCorrector != null)
            {
                faceMaskColorCorrector.Dispose();
            }

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

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

            #if UNITY_WEBGL && !UNITY_EDITOR
            if (getFilePath_Coroutine != null)
            {
                StopCoroutine(getFilePath_Coroutine);
                ((IDisposable)getFilePath_Coroutine).Dispose();
            }
            #endif
        }
Beispiel #3
0
        /// <summary>
        /// Raises the disable event.
        /// </summary>
        void OnDestroy()
        {
            capture.release();

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

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

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

            foreach (var key in lowPassFilterDict.Keys)
            {
                lowPassFilterDict [key].Dispose();
            }
            lowPassFilterDict.Clear();
            foreach (var key in opticalFlowFilterDict.Keys)
            {
                opticalFlowFilterDict [key].Dispose();
            }
            opticalFlowFilterDict.Clear();

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

            if (frontalFaceChecker != null)
            {
                frontalFaceChecker.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()
        {
            if (webCamTextureToMatHelper != null)
            {
                webCamTextureToMatHelper.Dispose();
            }

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

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

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

            foreach (var key in lowPassFilterDict.Keys)
            {
                lowPassFilterDict[key].Dispose();
            }
            lowPassFilterDict.Clear();
            foreach (var key in opticalFlowFilterDict.Keys)
            {
                opticalFlowFilterDict[key].Dispose();
            }
            opticalFlowFilterDict.Clear();

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

#if UNITY_WEBGL
            if (getFilePath_Coroutine != null)
            {
                StopCoroutine(getFilePath_Coroutine);
                ((IDisposable)getFilePath_Coroutine).Dispose();
            }
#endif
        }