c# -Windows form- Emgu- read a single frame from video?

-1

I'm using this code for read a single frame from video and use that frame like a image

protected void ReadSingleFrame()
    {
        Mat m = new Mat();
        if(IsReadingFrame ==true && frameNo >= 0 && frameNo < totalFrame - 1)
        {
            capture.SetCaptureProperty(Emgu.CV.CvEnum.CapProp.PosFrames, frameNo);
            capture.Read(m);
            Img = m.Bitmap;
            LabelFrame.Text ="Frame: "+ frameNo.ToString() + "/" + totalFrame.ToString();               
        }            
    }

but it ussualy crash because: Exception thrown at 0x74C59EBA (msvcrt.dll) in SelectObject.exe: 0xC0000005: Access violation reading location 0x11BD8000

how can i fix that error?

c#
winforms
opencv
video-capture
emgucv
asked on Stack Overflow Mar 18, 2019 by HueNguyen • edited Mar 18, 2019 by HueNguyen

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0