Ejemplo n.º 1
0
    void OnStoppedPhotoMode(PhotoCapture.PhotoCaptureResult result)
    {
        if (!IsMyCapture)
        {
            lm = GameObject.Find("LoginManager").GetComponent <LoginManager>();
            StartCoroutine("Upload2", lm.token);
        }
        else
        {
            // Shutdown our photo capture resource
            photoCaptureObject.Dispose();
            photoCaptureObject = null;

            IsMyCapture = false;
            Capture_Right_Menu.SetActive(false);
            CapturedImage.SetActive(true);
            Texture2D texture     = new Texture2D(0, 0);
            byte[]    byteTexture = File.ReadAllBytes(filePath);
            if (byteTexture.Length > 0)
            {
                texture.LoadImage(byteTexture);
            }
            CapturedImage.GetComponent <RawImage>().texture = texture;
            Invoke("CaptureLerp", 1f);
        }
    }
    //クリックされた時
    void IInputClickHandler.OnInputClicked(InputClickedEventData eventData)
    {
        if (Time.frameCount - time < 15 & finished)
        {
            Debug.Log("ara:clicked");

            finished = false;

            if (!isCapturing)
            {
                audioSource.PlayOneShot(try_get_pcl);
                PointAll.Clear();
                ColorAll.Clear();
                not_hitted_pixel.Clear();

                if (photoCaptureObject != null)
                {
                    photoCaptureObject.Dispose();
                    photoCaptureObject = null;
                }
                PhotoCapture.CreateAsync(false, Start_take_picture);
                isCapturing = true;
            }
        }
        time = Time.frameCount;
    }
Ejemplo n.º 3
0
    private void OnDestroy()
    {
        CancelInvoke();

        if (photoCaptureObject != null)
        {
            // Dispose from the object in memory
            photoCaptureObject.Dispose();
            photoCaptureObject = null;
        }
    }
Ejemplo n.º 4
0
 void IInputClickHandler.OnInputClicked(InputClickedEventData eventData)
 {
     if (!isCapturing)
     {
         if (photoCaptureObject != null)
         {
             photoCaptureObject.Dispose();
             photoCaptureObject = null;
         }
         PhotoCapture.CreateAsync(false, OnPhotoCaptureCreated);
         isCapturing = true;
     }
 }
 void OnStoppedPhotoMode(PhotoCapture.PhotoCaptureResult result)
 {
     // Shutdown the photo capture resource
     photoCaptureObject.Dispose();
     photoCaptureObject   = null;
     flag_camisprocessing = false;
 }
Ejemplo n.º 6
0
 private void OnStoppedPhotoMode(PhotoCapture.PhotoCaptureResult result)
 {
     // Shutdown the photo capture resource
     photoCaptureObject.Dispose();
     photoCaptureObject = null;
     OnPhotoModeEnded?.Invoke();
 }
 protected override void OnDestroy()
 {
     base.OnDestroy();
     // release photo capture resource
     capturer.Dispose();
     capturer = null;
 }
Ejemplo n.º 8
0
    /// <summary>
    /// The camera photo mode has stopped after the capture.
    /// Begin the Image Analysis process.
    /// </summary>
    void OnStoppedPhotoMode(PhotoCapture.PhotoCaptureResult result)
    {
        //Play sound since the object has been recognized
        //AudioPlay.Instance.Play();

        Debug.LogFormat("Stopped Photo Mode");

        // Dispose from the object in memory and request the image analysis
        photoCaptureObject.Dispose();
        photoCaptureObject = null;

        switch (AppMode)
        {
        case AppModes.Analysis:
        case AppModes.Smart:
            // Call the image analysis
            StartCoroutine(CustomVisionAnalyser.Instance.AnalyseLastImageCaptured(filePath));
            break;

        case AppModes.Training:
            // Call training using captured image
            UploadPhoto(null);
            break;
        }
    }
Ejemplo n.º 9
0
    void OnStoppedPhotoMode(PhotoCapture.PhotoCaptureResult result)
    {
        photoCaptureObj.Dispose();
        photoCaptureObj = null;

        Debug.Log("Stopped Photo Mode Succeed!");
    }
Ejemplo n.º 10
0
 void OnStoppedPhotoMode(PhotoCapture.PhotoCaptureResult result)
 {
     // Shutdown our photo capture resource
     photoCaptureObject.Dispose();
     photoCaptureObject = null;
     Debug.Log("DISPOSED AND STOPPED PHOTO MODE");
 }
    private void OnPhotoCaptureCreated(PhotoCapture photoCaptureObject)
    {
        if (photoCaptureObject == null)
        {
            Debug.LogError("Photo Capture could not be created");
        }

        Debug.LogError("Photo Capture created");
        _photoCaptureObject = photoCaptureObject;

        var supportedResolutions = (Resolution[])PhotoCapture.SupportedResolutions;

        // emulator cannot take photos
        if (supportedResolutions.Length == 0)
        {
            Debug.LogError("Photo mode could not be started. Are you using an emulator?");
            _photoCaptureObject.Dispose();
            _photoCaptureObject = null;
            return;
        }

        // needed for starting photo mode
        _cameraParameters = new CameraParameters();
        _cameraParameters.hologramOpacity        = 0.0f;
        _cameraParameters.cameraResolutionWidth  = _cameraResolution.width;
        _cameraParameters.cameraResolutionHeight = _cameraResolution.height;
        cameraWidth  = _cameraParameters.cameraResolutionWidth;
        cameraHeight = _cameraParameters.cameraResolutionHeight;
        _cameraParameters.pixelFormat = CapturePixelFormat.BGRA32;

        // Activate the web camera
        _photoCaptureObject.StartPhotoModeAsync(_cameraParameters, OnPhotoModeStarted);
    }
Ejemplo n.º 12
0
 private void OnStoppedPhotoMode(PhotoCapture.PhotoCaptureResult result)
 {
     // Shutdown the photo capture resource
     photoCaptureObject.Dispose();
     photoCaptureObject = null;
     captureStarted     = false;
 }
 void OnStoppedPhotoMode(PhotoCapture.PhotoCaptureResult result)
 {
     // Dispose from the object in memory and request the image analysis
     // to the VisionManager class
     photoCaptureObject.Dispose();
     photoCaptureObject = null;
 }
Ejemplo n.º 14
0
 private void OnStoppedPhotoMode(PhotoCapture.PhotoCaptureResult result)
 {
     _photoCaptureObject?.Dispose();
     _photoCaptureObject = null;
     _stopped.SetResult(true);
     Debug.Log("Photo mode stopped.");
 }
Ejemplo n.º 15
0
 private void OnStoppedPhotoMode(PhotoCapture.PhotoCaptureResult result)
 {
     VuforiaBehaviour.Instance.enabled = true;
     _photoCapture.Dispose();
     _photoCapture = null;
     _filePath     = "";
 }
        void OnStopPhotoMode(PhotoCapture.PhotoCaptureResult result)
        {
            Debug.Log("StopPhotoMode!");
            m_PhotoCaptureObj.Dispose();

            isPhotoModeRunning = false;
        }
Ejemplo n.º 17
0
 void OnStoppedPhotoMode(PhotoCapture.PhotoCaptureResult result)
 {
     // Shutdown the photo capture resource
     photoCaptureObject.Dispose();
     photoCaptureObject = null;
     MixedRealityCapture.Instance.AfterTakeAPicture();
 }
Ejemplo n.º 18
0
        // For when photo taking is manually stopped (clean up)
        public static void OnStoppedPhotoMode(PhotoCapture.PhotoCaptureResult result)
        {
            if (Constants.DebugStrings.DebugFlag)
            {
                // ERROR TESTING REMOVE?
                Debug.Log(Constants.DebugStrings.PhotoCaptured);
            }

            // Disable the ability to take screenshots until the photo capture mode is started again
            Interactions.DisableVoiceCommand(Constants.Commands.VoiceCommandsEnum.RoomScreenshot);
            Interactions.DisableGesture(Constants.Commands.GesturesEnum.RoomScreenshot);

            // Destroy the photo capture object for memory management
            photoCaptureObject.Dispose();
            photoCaptureObject = null;

            if (Constants.DebugStrings.DebugFlag)
            {
                // ERROR TESTING ADD THIS TEXT TO DEBUG STRINGS
                Debug.Log("Photo capture mode ended successfully.");
            }

            // Let manager know texture capture is finished
            GameObject.Find("TextureManager").GetComponent <TextureManager>().Trigger_TextureCaptureFinished();
            // ERROR TESTING REMOVE
            //TextureManager.Trigger_TextureCaptureFinished();

            // ERROR TESTING UNHOOK AND RELOCATE
            //CentralProcessor.GenerateTexturePrefab();

            // Destroy the temporary DisplayManager helper
            DisplayManager.DestroyDisplay();
        }
Ejemplo n.º 19
0
        private void ReleaseCamera()
        {
            if (PhotoCap == null || asyncCameraReleaseStarted)
            {
                return;
            }

            asyncCameraReleaseStarted = true;

            PhotoCap.StopPhotoModeAsync((PhotoCapture.PhotoCaptureResult result) =>
            {
                asyncCameraReleaseStarted = false;

                if (result.success)
                {
                    PhotoCap.Dispose();
                    PhotoCap                = null;
                    cameraReady             = false;
                    asyncCameraSetupStarted = false;
                    this.releaseAttempts    = 0;
                }
                else
                {
                    if (this.releaseAttempts <= this.maxReleaseAttempts)
                    {
                        this.RequestReleaseCamera();
                    }

                    ++this.releaseAttempts;
                }
            });
        }
Ejemplo n.º 20
0
    protected override void OnDestroy()
    {
        StopCoroutine(loopCoroutine);
        capture.StopPhotoModeAsync(e => { capture.Dispose(); });


        base.OnDestroy();
    }
Ejemplo n.º 21
0
    void OnStoppedPhotoMode(PhotoCapture.PhotoCaptureResult result) /// Register the full execution of the Photo Capture. If successfull, it will begin the Image Analysis process.
    {
        photoCaptureObject.Dispose();
        photoCaptureObject = null;

        // Request image caputer analysis
        StartCoroutine(FaceAnalysis.Instance.DetectFacesFromImage());
    }
Ejemplo n.º 22
0
 void OnStoppedPhotoMode(PhotoCapture.PhotoCaptureResult result)
 {
     // Shutdown the photo capture resource
     photoCaptureObject.Dispose();
     photoCaptureObject = null;
     //Debug.Log("disposed of photo");
     taking = false;
 }
    void OnStoppedPhotoMode(PhotoCapture.PhotoCaptureResult result)
    {
        photoCaptureObject.Dispose();
        photoCaptureObject = null;

        Debug.Log("Captured images have been saved at the following path.");
        Debug.Log(Application.persistentDataPath);
    }
Ejemplo n.º 24
0
 void OnStoppedPhotoMode(PhotoCapture.PhotoCaptureResult result)
 {
     // Dispose from the object in memory and request the image analysis
     // to the VisionManager class
     photoCaptureObject.Dispose();
     photoCaptureObject = null;
     StartCoroutine(VisionManager.instance.AnalyseLastImageCaptured());
 }
    private void OnPhotoModeStopped(PhotoCapture.PhotoCaptureResult result)
    {
        capture.Dispose();
        capture = null;
        isReady = false;

        Info.text = "Camera off";
    }
Ejemplo n.º 26
0
    //在拍照结束时,capturingPhoto为假,capturingSucceed为真
    void OnStoppedPhotoMode(PhotoCapture.PhotoCaptureResult result)
    {
        photoCaptureObj.Dispose();
        photoCaptureObj = null;

        capturingPhoto = false;
        UnityEngine.Debug.Log("Stopped Photo Mode Succeed!");
    }
    private void OnPhotoModeStopped(PhotoCapture.PhotoCaptureResult result)
    {
        _capture.Dispose();
        _capture       = null;
        _isCameraReady = false;

        SetStatus("Camera off");
    }
Ejemplo n.º 28
0
    /// <summary>
    /// Register the full execution of the Photo Capture. If successfull, it will begin the Image Analysis process.
    /// </summary>
    void OnStoppedPhotoMode(PhotoCapture.PhotoCaptureResult result)
    {
        photoCaptureObject.Dispose();
        photoCaptureObject = null;

        // Request image caputer analysis
        StartCoroutine(FaceAnalysis.Instance.DetectFacesFromImage());
    }
Ejemplo n.º 29
0
        private void onPhotoModeStoppedCallback(PhotoCapture.PhotoCaptureResult result)
        {
            photoCapture.Dispose();
            photoCapture = null;

            canSave            = false;
            canTakePhoto.Value = true;
        }
        private void OnStoppedPhotoMode(PhotoCapture.PhotoCaptureResult result)
        {
            // photo capture のリソースをシャットダウンします
            photoCaptureObject.Dispose();
            photoCaptureObject = null;

            photoTaking = false;
            debug.text  = "写真撮影終了";
        }