예제 #1
0
        /// <summary>
        /// Raises the change camera button click event.
        /// </summary>
        public void OnChangeCameraButtonClick()
        {
            if (isImagesInputMode)
            {
                return;
            }

            webCamTextureToMatHelper.Initialize(null, webCamTextureToMatHelper.requestedWidth, webCamTextureToMatHelper.requestedHeight, !webCamTextureToMatHelper.requestedIsFrontFacing);
        }
예제 #2
0
        /// <summary>
        /// Raises the use stored camera parameters toggle value changed event.
        /// </summary>
        public void OnUseStoredCameraParametersToggleValueChanged()
        {
            useStoredCameraParameters = useStoredCameraParametersToggle.isOn;

            if (webCamTextureToMatHelper != null && webCamTextureToMatHelper.IsInitialized())
            {
                webCamTextureToMatHelper.Initialize();
            }
        }
        // Use this for initialization
        IEnumerator Start()
        {
            webCamTextureToMatHelper = gameObject.GetComponent <HololensCameraStreamToMatHelper>();
            webCamTextureToMatHelper.outputColorFormat = WebCamTextureToMatHelper.ColorFormat.GRAY;

            // fix the screen orientation.
            Screen.orientation = ScreenOrientation.LandscapeLeft;
            // wait for the screen orientation to change.
            yield return(null);

            if (markerTypeDropdown.value != (int)markerType || dictionaryIdDropdown.value != (int)dictionaryId ||
                squaresXDropdown.value != (int)squaresX - 1 || squaresYDropdown.value != (int)squaresY - 1)
            {
                markerTypeDropdown.value   = (int)markerType;
                dictionaryIdDropdown.value = (int)dictionaryId;
                squaresXDropdown.value     = (int)squaresX - 1;
                squaresYDropdown.value     = (int)squaresY - 1;
            }
            dictionaryIdDropdown.interactable = (markerType == MarkerType.ChArUcoBoard);

#if UNITY_WEBGL && !UNITY_EDITOR
            isImagesInputMode = false;
#endif
            if (isImagesInputMode)
            {
                isImagesInputMode = InitializeImagesInputMode();
            }

            if (!isImagesInputMode)
            {
                webCamTextureToMatHelper.Initialize();
            }
        }
 /// <summary>
 /// Registers callback for incoming video frames and starts capturing video frames
 /// </summary>
 private void InitWebCamHelper()
 {
     #if ENABLE_WINMD_SUPPORT
     webCamTextureToMatHelper.frameMatAcquired += OnFrameMatAcquired;
     #endif
     webCamTextureToMatHelper.Initialize();
 }
예제 #5
0
 // Use this for initialization
 void Start()
 {
     webCamTextureToMatHelper = gameObject.GetComponent <HololensCameraStreamToMatHelper> ();
     #if NETFX_CORE && !DISABLE_HOLOLENSCAMSTREAM_API
     webCamTextureToMatHelper.frameMatAcquired += OnFrameMatAcquired;
     #endif
     webCamTextureToMatHelper.Initialize();
 }
예제 #6
0
        // Use this for initialization
        protected void Start()
        {
            webCamTextureToMatHelper = gameObject.GetComponent <HololensCameraStreamToMatHelper> ();
            #if WINDOWS_UWP && !DISABLE_HOLOLENSCAMSTREAM_API
            webCamTextureToMatHelper.frameMatAcquired += OnFrameMatAcquired;
            #endif
            webCamTextureToMatHelper.Initialize();

            VignetteScaleSlider.value = vignetteScale;
        }
예제 #7
0
        // Use this for initialization
        protected override void Start()
        {
            base.Start();

            webCamTextureToMatHelper = gameObject.GetComponent <HololensCameraStreamToMatHelper> ();
            #if WINDOWS_UWP && !DISABLE_HOLOLENSCAMSTREAM_API
            webCamTextureToMatHelper.frameMatAcquired += OnFrameMatAcquired;
            #endif
            webCamTextureToMatHelper.Initialize();
        }
        /// <summary>
        /// Raises the marker type dropdown value changed event.
        /// </summary>
        public void OnMarkerTypeDropdownValueChanged(int result)
        {
            if ((int)markerType != result)
            {
                markerType = (MarkerType)result;

                dictionaryIdDropdown.interactable = (markerType == MarkerType.ChArUcoBoard);

                if (isImagesInputMode)
                {
                    InitializeImagesInputMode();
                }
                else
                {
                    if (webCamTextureToMatHelper.IsInitialized())
                    {
                        webCamTextureToMatHelper.Initialize();
                    }
                }
            }
        }
        // Use this for initialization
        void Start()
        {
            //useSeparateDetectionToggle.isOn = useSeparateDetection;

            webCamTextureToMatHelper = gameObject.GetComponent <HololensCameraStreamToMatHelper> ();
            #if NETFX_CORE && !DISABLE_HOLOLENSCAMSTREAM_API
            webCamTextureToMatHelper.frameMatAcquired += OnFrameMatAcquired;
            #endif
            webCamTextureToMatHelper.Initialize();

            rectangleTracker = new RectangleTracker();
            rectOverlay      = gameObject.GetComponent <RectOverlay> ();
        }
예제 #10
0
        // Use this for initialization
        void Start()
        {
            displayCameraPreviewToggle.isOn      = displayCameraPreview;
            useStoredCameraParametersToggle.isOn = useStoredCameraParameters;
            enableLowPassFilterToggle.isOn       = enableLowPassFilter;

            imageOptimizationHelper  = gameObject.GetComponent <ImageOptimizationHelper> ();
            webCamTextureToMatHelper = gameObject.GetComponent <HololensCameraStreamToMatHelper> ();
            #if NETFX_CORE && !DISABLE_HOLOLENSCAMSTREAM_API
            webCamTextureToMatHelper.frameMatAcquired += OnFrameMatAcquired;
            #endif

            webCamTextureToMatHelper.Initialize();
        }
예제 #11
0
        // Use this for initialization
        protected void Start()
        {
            displayCameraPreviewToggle.isOn      = displayCameraPreview;
            useStoredCameraParametersToggle.isOn = useStoredCameraParameters;
            enableDownScaleToggle.isOn           = enableDownScale;
            enableLerpFilterToggle.isOn          = enableLerpFilter;

            imageOptimizationHelper  = gameObject.GetComponent <ImageOptimizationHelper>();
            webCamTextureToMatHelper = gameObject.GetComponent <HololensCameraStreamToMatHelper>();
#if WINDOWS_UWP && !DISABLE_HOLOLENSCAMSTREAM_API
            webCamTextureToMatHelper.frameMatAcquired += OnFrameMatAcquired;
#endif
            webCamTextureToMatHelper.outputColorFormat = WebCamTextureToMatHelper.ColorFormat.GRAY;
            webCamTextureToMatHelper.Initialize();
        }
        // Use this for initialization
        protected void Start()
        {
            imageOptimizationHelper  = gameObject.GetComponent <ImageOptimizationHelper>();
            webCamTextureToMatHelper = gameObject.GetComponent <HololensCameraStreamToMatHelper>();
#if WINDOWS_UWP && !DISABLE_HOLOLENSCAMSTREAM_API
            webCamTextureToMatHelper.frameMatAcquired += OnFrameMatAcquired;
#endif
            webCamTextureToMatHelper.Initialize();

            rectangleTracker = new RectangleTracker();
            rectOverlay      = gameObject.GetComponent <RectOverlay>();

            useSeparateDetectionToggle.isOn = useSeparateDetection;
            enableDownScaleToggle.isOn      = enableDownScale;
        }
예제 #13
0
        //HololensVideoWriterAsPlugin recorder;

        // Use this for initialization
        protected override void Start()
        {
            fpsMonitor = GetComponent <FpsMonitor>();

            base.Start();

            webCamTextureToMatHelper = gameObject.GetComponent <HololensCameraStreamToMatHelper>();

            #if NETFX_CORE && !DISABLE_HOLOLENSCAMSTREAM_API
            webCamTextureToMatHelper.frameMatAcquired += OnFrameMatAcquired;
            #endif
            webCamTextureToMatHelper.Initialize();

            cameraInstance = GameObject.FindWithTag("MainCamera").GetComponent <Camera>();

            //29n
            //recorder = gameObject.GetComponent<HololensVideoWriterAsPlugin>();
        }
        // Use this for initialization
        new IEnumerator Start()
        {
            camera = FindObjectOfType <HoloToolkit.Unity.InputModule.MixedRealityCameraManager>();
            cursor = FindObjectOfType <HoloToolkit.Unity.InputModule.Cursor>();
            input  = FindObjectOfType <HoloToolkit.Unity.InputModule.InputManager>();

            webCamTextureToMatHelper = gameObject.GetComponent <HololensCameraStreamToMatHelper> ();

            // fix the screen orientation.
            Screen.orientation = ScreenOrientation.LandscapeLeft;
            // wait for the screen orientation to change.
            yield return(null);

            if (markerTypeDropdown.value != (int)markerType || dictionaryIdDropdown.value != (int)dictionaryId ||
                squaresXDropdown.value != (int)squaresX - 1 || squaresYDropdown.value != (int)squaresY - 1)
            {
                markerTypeDropdown.value   = (int)markerType;
                dictionaryIdDropdown.value = (int)dictionaryId;
                squaresXDropdown.value     = (int)squaresX - 1;
                squaresYDropdown.value     = (int)squaresY - 1;
            }
            dictionaryIdDropdown.interactable = (markerType == MarkerType.ChArUcoBoard);

            #if UNITY_WEBGL && !UNITY_EDITOR
            isImagesInputMode = false;
            #endif
            if (isImagesInputMode)
            {
                isImagesInputMode = InitializeImagesInputMode();
            }

            if (!isImagesInputMode)
            {
                webCamTextureToMatHelper.Initialize();
            }
        }
예제 #15
0
 /// <summary>
 /// Raises the change camera button click event.
 /// </summary>
 public void OnChangeCameraButtonClick()
 {
     webCamTextureToMatHelper.Initialize(null, webCamTextureToMatHelper.requestedWidth, webCamTextureToMatHelper.requestedHeight, !webCamTextureToMatHelper.requestedIsFrontFacing);
 }