void Update() { if (_webCamTexture.isPlaying && _webCamTexture.didUpdateThisFrame) { openCVImage.TextureToMat(_webCamTexture.GetPixels32()); } }
// Update is called once per frame void Update() { if (CameraDevice.Instance.IsActive()) { if (CameraDevice.Instance.SetFrameFormat(Image.PIXEL_FORMAT.RGBA8888, true)) { CameraDevice.Instance.GetCameraImage(Image.PIXEL_FORMAT.RGBA8888).CopyToTexture(webCamImage); openCVImage.TextureToMat(webCamImage.GetPixels32()); } } }
void Update() { try { vuforiaCamera.targetTexture = renderTexture; vuforiaCamera.Render (); RenderTexture.active = renderTexture; screenShot.ReadPixels (screenShotRect, 0, 0); screenShot.Apply(); openCVImage.TextureToMat(screenShot.GetPixels32()); } finally { vuforiaCamera.targetTexture = null; } }