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

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

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

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

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

            if (des != null)
            {
                des.Dispose();
            }
        }
コード例 #3
0
        /// <summary>
        /// Clear and reset the model. Required Init function to be called again before calling ProcessAndRender.
        /// </summary>
        public void Clear()
        {
            if (_hog != null)
            {
                _hog.Dispose();
                _hog = null;
            }

            if (_hogCuda != null)
            {
                _hogCuda.Dispose();
                _hog = null;
            }
        }
コード例 #4
0
        /// <summary>
        /// Raises the destroy event.
        /// </summary>
        void OnDestroy()
        {
            capture.release();

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

            if (des != null)
            {
                des.Dispose();
            }
        }
コード例 #5
0
        protected override void DisposeObject()
        {
            if (_hog != null)
            {
                _hog.Dispose();
                _hog = null;
            }

            if (_hogCuda != null)
            {
                _hogCuda.Dispose();
                _hog = null;
            }
        }
コード例 #6
0
        /// <summary>
        /// Clear and reset the model. Required Init function to be called again before calling ProcessAndRender.
        /// </summary>
        public void Clear()
        {
            if (_hog != null)
            {
                _hog.Dispose();
                _hog = null;
            }

#if !(UNITY_EDITOR || UNITY_IOS || UNITY_ANDROID || UNITY_STANDALONE)
            if (_hogCuda != null)
            {
                _hogCuda.Dispose();
                _hog = null;
            }
#endif
        }
コード例 #7
0
        private float classifyShape(Mat shape, CvSVM svm)
        {
            HOGDescriptor hog = new HOGDescriptor();

            hog.WinSize     = new OpenCvSharp.CPlusPlus.Size(32, 32); // Set hog features here: winSize; blockSize; cellSize
            hog.BlockSize   = new OpenCvSharp.CPlusPlus.Size(4, 4);
            hog.CellSize    = new OpenCvSharp.CPlusPlus.Size(4, 4);
            hog.BlockStride = new OpenCvSharp.CPlusPlus.Size(2, 2);
            float[] features = hog.Compute(shape, new OpenCvSharp.CPlusPlus.Size(16, 16), new OpenCvSharp.CPlusPlus.Size(0, 0), null);
            hog.Dispose();
            Mat   featureMat = new Mat(1, features.Length, MatType.CV_32FC1, features);
            float prediction = svm.Predict(featureMat.ToCvMat());

            featureMat.Dispose();
            return(prediction);
        }
コード例 #8
0
        /// <summary>
        /// Raises the destroy event.
        /// </summary>
        void OnDestroy()
        {
            capture.release();

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

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

            if (des != null)
            {
                des.Dispose();
            }
        }
コード例 #9
0
 public override void Dispose()
 {
     _hog.Dispose();
 }