示例#1
0
 void OnStoppedPhotoMode(UnityEngine.Windows.WebCam.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());
 }
示例#2
0
 void OnCapturedPhotoToDisk(UnityEngine.Windows.WebCam.PhotoCapture.PhotoCaptureResult result)
 {
     if (result.success)
     {
         Debug.Log("Saved Photo to disk!");
         photoCapture.StopPhotoModeAsync(OnStoppedPhotoMode);
     }
     else
     {
         Debug.Log("Failed to save Photo to disk");
     }
 }
示例#3
0
        private static PhotoCapture.PhotoCaptureResult MakeCaptureResult(long hResult)
        {
            PhotoCapture.PhotoCaptureResult result = default(PhotoCapture.PhotoCaptureResult);
            bool flag = hResult == PhotoCapture.HR_SUCCESS;

            PhotoCapture.CaptureResultType resultType;
            if (flag)
            {
                resultType = PhotoCapture.CaptureResultType.Success;
            }
            else
            {
                resultType = PhotoCapture.CaptureResultType.UnknownError;
            }
            result.resultType = resultType;
            result.hResult    = hResult;
            return(result);
        }
示例#4
0
 private void OnPhotoModeStarted(UnityEngine.Windows.WebCam.PhotoCapture.PhotoCaptureResult result)
 {
     /* Load to Memory */
     if (result.success)
     {
         try
         {
             photoCapture.TakePhotoAsync(OnCapturedPhotoToMemory);
         }
         catch (System.ArgumentException e)
         {
             Debug.LogError("System.ArgumentException:\n" + e.Message);
         }
     }
     else
     {
         Debug.LogError("Unable to start photo mode!");
     }
 }
示例#5
0
    void OnCapturedPhotoToMemory(UnityEngine.Windows.WebCam.PhotoCapture.PhotoCaptureResult result, UnityEngine.Windows.WebCam.PhotoCaptureFrame photoCaptureFrame)
    {
        if (result.success)
        {
            List <byte> imageBufferList = new List <byte>();

            Debug.Log("OnCapturedPhotoToMemory Copy Started");

            photoCaptureFrame.CopyRawImageDataIntoBuffer(imageBufferList);

            Debug.Log("OnCapturedPhotoToMemory " + imageBufferList.Count);

            //Execute OCR Coroutine
            ExecuteMCSComputerVisionOCR(imageBufferList);
        }
        else
        {
            Debug.Log("Failed to save Photo to memory");
        }

        photoCapture.StopPhotoModeAsync(OnStoppedPhotoMode);
    }
示例#6
0
 /// <summary>
 /// Register the full execution of the Photo Capture. If successful, it will begin
 /// the Image Analysis process.
 /// </summary>
 void OnCapturedPhotoToDisk(UnityEngine.Windows.WebCam.PhotoCapture.PhotoCaptureResult result)
 {
     // Call StopPhotoMode once the image has successfully captured
     photoCaptureObject.StopPhotoModeAsync(OnStoppedPhotoMode);
 }
示例#7
0
 private void OnStoppedPhotoMode(UnityEngine.Windows.WebCam.PhotoCapture.PhotoCaptureResult result)
 {
     photoCapture.Dispose();
     photoCapture = null;
 }