Kawaian / OpenCvSharp

OpenCV for Xamarin (Forked from shimat/opencvsharp)
BSD 3-Clause "New" or "Revised" License
48 stars 19 forks source link

Problem with this line #16

Open maxrodro opened 3 years ago

maxrodro commented 3 years ago

Hello everybody,

I am using OpenCvSharp in my Xamarin Forms to capture the video and process the resulting Frame, but this line remains and does not continue with the following lines of code, any ideas?

File: AndroidCapture.cs

` capturedBuffer = mat;

        var k = 0;  // -->   it works yes I uncomment and comment the following line
        var k = Cv2.WaitKey(0); // ---> Stop Code

        var args = new FrameArgs(mat, (char)k);

        if (MultiThread)
        {
            lock (capturedBufferLocker)
            {
                if (lastFrame > frameIndex)
                {
                    if (mat != null)
                        mat.Dispose();
                    mat = null;
                    CvProfiler.Count("CaptureSkipped");
                    return;
                }

                lastFrame = frameIndex;
                FrameReady?.Invoke(this, args);
            }
        }
        else
        {
            FrameReady?.Invoke(this, args);
        }

        if (args.MatDispose)
        {
            mat.Release();
            mat.Dispose();
            mat = null;
        }

`

MateuszSiwiecki commented 3 years ago

Try delete line var k = Cv2.WaitKey(0);