/// <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 }
/// <summary> /// Raises the destroy event. /// </summary> void OnDestroy() { if (sourceToMatHelper != null) { sourceToMatHelper.Dispose(); } if (des != null) { des.Dispose(); } }
/// <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; } }
/// <summary> /// Raises the destroy event. /// </summary> void OnDestroy() { capture.release(); if (rgbMat != null) { rgbMat.Dispose(); } if (des != null) { des.Dispose(); } }
protected override void DisposeObject() { if (_hog != null) { _hog.Dispose(); _hog = null; } if (_hogCuda != null) { _hogCuda.Dispose(); _hog = null; } }
/// <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 }
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); }
/// <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(); } }
public override void Dispose() { _hog.Dispose(); }