private void Update()
    {
        frameCount++;
        if (frameCount == 48)
        {
            Debug.Log("Trying to recognize now");
            texture = webcam.GetCurrFrame();

            // Set the texture for the image we want to recognize, set it to 32bit
            //  texture = new Texture2D(currentFrame.width, currentFrame.height, TextureFormat.ARGB32, false);
            //  texture.SetPixels32(currentFrame.GetPixels32());
            texture.Apply();

            snap = new Texture2D(texture.width, texture.height);
            snap.SetPixels(texture.GetPixels());
            snap.Apply();



            _tesseractDriver = new TesseractDriver();



            // Recognize the Texture
            Recognize(snap);


            // Display the image
            SetImageDisplay();
        }
        else
        {
            return;
        }
    }
예제 #2
0
    private void Start()
    {
        Texture2D texture = new Texture2D(imageToRecognize.width, imageToRecognize.height, TextureFormat.ARGB32, false);

        texture.SetPixels32(imageToRecognize.GetPixels32());
        texture.Apply();

        _tesseractDriver = new TesseractDriver();
        Recoginze(texture);
    }
예제 #3
0
    private void Awake()
    {
        _output.gameObject.SetActive(false);
        _cameraButton.onClick.AddListener(OnCameraButtonPressed);
        _backButton.onClick.AddListener(OnBackButtonPressed);

        SetControlsState(ControlsState.Processing);

        _tesseractDriver = new TesseractDriver();
        _tesseractDriver.Setup(() =>
        {
            SetControlsState(ControlsState.Capture);
        });
    }
예제 #4
0
    public void Launch()
    {
        Texture2D texture = new Texture2D(imageToRecognize.width, imageToRecognize.height, TextureFormat.ARGB32, false);

        texture.SetPixels32(imageToRecognize.GetPixels32());
        texture.Apply();

        _tesseractDriver         = new TesseractDriver();
        _tesseractDriver.rapport = rapport;
        _tesseractDriver.prefab  = prefab;
        _tesseractDriver.parent  = parent;
        _tesseractDriver.x       = texture.width;
        _tesseractDriver.y       = texture.height;
        Recoginze(texture);
    }
    private void Start()
    {
        // Set the texture for the image we want to recognize, set it to 32bit
        Texture2D texture = new Texture2D(imageToRecognize.width,
                                          imageToRecognize.height, TextureFormat.ARGB32, false);

        texture.SetPixels32(imageToRecognize.GetPixels32());
        texture.Apply();

        _tesseractDriver = new TesseractDriver();
        // Recognize the Texture
        Recoginze(texture);

        // Display the image
        SetImageDisplay();
    }