// Use this for initialization void Start() { webCamTextureToMatHelper = gameObject.GetComponent <WebCamTextureToMatHelper> (); #if UNITY_WEBGL && !UNITY_EDITOR var filepath_Coroutine = Utils.getFilePathAsync("lbpcascade_frontalface.xml", (result) => { coroutineStack.Clear(); cascade = new CascadeClassifier(); cascade.load(result); webCamTextureToMatHelper.Init(); }); coroutineStack.Push(filepath_Coroutine); StartCoroutine(filepath_Coroutine); #else cascade = new CascadeClassifier(); cascade.load(Utils.getFilePath("lbpcascade_frontalface.xml")); // cascade = new CascadeClassifier (); // cascade.load (Utils.getFilePath ("haarcascade_frontalface_alt.xml")); // if (cascade.empty ()) { // Debug.LogError ("cascade file is not loaded.Please copy from “OpenCVForUnity/StreamingAssets/” to “Assets/StreamingAssets/” folder. "); // } webCamTextureToMatHelper.Init(); #endif }
// Use this for initialization void Start() { #if !UNITY_WEBGL || UNITY_EDITOR weightsPositionsSmoothing.Add(1); weightsSizesSmoothing.Add(0.5f); weightsSizesSmoothing.Add(0.3f); weightsSizesSmoothing.Add(0.2f); //parameters.minObjectSize = 96; //parameters.maxObjectSize = int.MaxValue; //parameters.scaleFactor = 1.1f; //parameters.minNeighbors = 2; parameters.maxTrackLifetime = 5; innerParameters.numLastPositionsToTrack = 4; innerParameters.numStepsToWaitBeforeFirstShow = 6; innerParameters.numStepsToTrackWithoutDetectingIfObjectHasNotBeenShown = 3; innerParameters.numStepsToShowWithoutDetecting = 3; innerParameters.coeffTrackingWindowSize = 2.0f; innerParameters.coeffObjectSizeToTrack = 0.85f; innerParameters.coeffObjectSpeedUsingInPrediction = 0.8f; #endif webCamTextureToMatHelper = gameObject.GetComponent <WebCamTextureToMatHelper> (); webCamTextureToMatHelper.Init(); }
// Use this for initialization void Start() { // Utils.setDebugMode (true); webCamTextureToMatHelper = gameObject.GetComponent <WebCamTextureToMatHelper> (); webCamTextureToMatHelper.Init(); }
// Use this for initialization void Start() { webCamTextureToMatHelper = gameObject.GetComponent <WebCamTextureToMatHelper> (); webCamTextureToMatHelper.Init(); isFlipHorizontalToggle.isOn = webCamTextureToMatHelper.flipVertical; isFlipHorizontalToggle.isOn = webCamTextureToMatHelper.flipHorizontal; }
// Use this for initialization void Start() { roiPointList = new List <Point> (); termination = new TermCriteria(TermCriteria.EPS | TermCriteria.COUNT, 10, 1); webCamTextureToMatHelper = gameObject.GetComponent <WebCamTextureToMatHelper> (); webCamTextureToMatHelper.Init(); }
// Use this for initialization void Start() { webCamTextureToMatHelper = gameObject.GetComponent <WebCamTextureToMatHelper> (); webCamTextureToMatHelper.Init(); backgroundSubstractorMOG2 = Video.createBackgroundSubtractorMOG2(); // backgroundSubstractorMOG2.setHistory (2); // backgroundSubstractorMOG2.setVarThreshold (16); // backgroundSubstractorMOG2.setDetectShadows (true); }
/// <summary> /// Raises the change camera button event. /// </summary> public void OnChangeCameraButton() { webCamTextureToMatHelper.Init(null, webCamTextureToMatHelper.requestWidth, webCamTextureToMatHelper.requestHeight, !webCamTextureToMatHelper.requestIsFrontFacing); }
// Use this for initialization void Start() { webCamTextureToMatHelper = gameObject.GetComponent <WebCamTextureToMatHelper> (); webCamTextureToMatHelper.Init(); }