/// <summary>
        /// Raises the destroy event.
        /// </summary>
        void OnDestroy()
        {
            webCamTextureToMatHelper.Dispose();

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

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

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

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

            #if UNITY_WEBGL && !UNITY_EDITOR
            foreach (var coroutine in coroutines)
            {
                StopCoroutine(coroutine);
                ((IDisposable)coroutine).Dispose();
            }
            #endif
        }
Esempio n. 2
0
        /// <summary>
        /// Raises the disable event.
        /// </summary>
        void OnDisable()
        {
            webCamTextureToMatHelper.Dispose();

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

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

            if (rvec != null)
            {
                rvec.Dispose();
            }
            if (tvec != null)
            {
                tvec.Dispose();
            }
            if (rotMat != null)
            {
                rotMat.Dispose();
            }
        }
        /// <summary>
        /// Raises the disable event.
        /// </summary>
        void OnDestroy()
        {
            WebGLFileUploadManager.FileUploadEventHandler -= fileUploadHandler;
            WebGLFileUploadManager.Dispose();

            capture.release();

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

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

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

            if (frontalFaceParam != null)
            {
                frontalFaceParam.Dispose();
            }
        }
        /// <summary>
        /// Raises the disable event.
        /// </summary>
        void OnDisable()
        {
            WebGLFileUploadManager.FileUploadEventHandler -= fileUploadHandler;
            WebGLFileUploadManager.Dispose();

            webCamTextureToMatHelper.Dispose();

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

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

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

            if (frontalFaceParam != null)
            {
                frontalFaceParam.Dispose();
            }
        }
        /// <summary>
        /// Raises the disable event.
        /// </summary>
        void OnDisable()
        {
            webCamTextureToMatHelper.Dispose();

            if (rectangleTracker != null)
            {
                rectangleTracker.Dispose();
            }
        }
Esempio n. 6
0
        /// <summary>
        /// Raises the destroy event.
        /// </summary>
        void OnDestroy()
        {
            #if NETFX_CORE && !DISABLE_HOLOLENSCAMSTREAM_API
            webCamTextureToMatHelper.frameMatAcquired -= OnFrameMatAcquired;
            #endif
            webCamTextureToMatHelper.Dispose();

            if (rectangleTracker != null)
            {
                rectangleTracker.Dispose();
            }
        }
Esempio n. 7
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()
        {
            imageOptimizationHelper.Dispose();
#if WINDOWS_UWP && !DISABLE_HOLOLENSCAMSTREAM_API
            webCamTextureToMatHelper.frameMatAcquired -= OnFrameMatAcquired;
#endif
            webCamTextureToMatHelper.Dispose();

            if (rectangleTracker != null)
            {
                rectangleTracker.Dispose();
            }
        }
        /// <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 (faceChanger != null)
            {
                faceChanger.Dispose();
            }

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

#if UNITY_WEBGL
            if (getFilePath_Coroutine != null)
            {
                StopCoroutine(getFilePath_Coroutine);
                ((IDisposable)getFilePath_Coroutine).Dispose();
            }
#endif
        }
Esempio n. 10
0
        /// <summary>
        /// Raises the destroy event.
        /// </summary>
        void OnDestroy()
        {
            imageOptimizationHelper.Dispose();
            #if NETFX_CORE
            webCamTextureToMatHelper.frameMatAcquired -= OnFrameMatAcquired;
            #endif
            webCamTextureToMatHelper.Dispose();

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

            if (rectangleTracker != null)
            {
                rectangleTracker.Dispose();
            }
        }
Esempio n. 11
0
        /// <summary>
        /// Raises the destroy event.
        /// </summary>
        void OnDestroy()
        {
            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 && !UNITY_EDITOR
            foreach (var coroutine in coroutines)
            {
                StopCoroutine(coroutine);
                ((IDisposable)coroutine).Dispose();
            }
            #endif
        }
Esempio n. 12
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();
            }

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

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

            #if UNITY_WEBGL && !UNITY_EDITOR
            foreach (var coroutine in coroutines)
            {
                StopCoroutine(coroutine);
                ((IDisposable)coroutine).Dispose();
            }
            #endif
        }
Esempio n. 13
0
        /// <summary>
        /// Raises the destroy event.
        /// </summary>
        void OnDestroy()
        {
            imageOptimizationHelper.Dispose();
            #if NETFX_CORE && !DISABLE_HOLOLENSCAMSTREAM_API
            webCamTextureToMatHelper.frameMatAcquired -= OnFrameMatAcquired;
            #endif
            webCamTextureToMatHelper.Dispose();

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

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

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