emgucv 不会读取视频/图像文件,从而收到 System.NullReferenceException 错误



这是我收到错误的代码的一部分;

private static void Main(string[] args)
    {
        #region Extract Model Face Detections From Video Clips
        var modelVideos = Directory.GetFiles(@"ModelsVideos", "*.MOV");
        foreach (var modelVideo in modelVideos)
        {
            var capture = new Capture(modelVideo);
            var framesQueue = new Queue<Image<Gray, byte>>();
            capture.ImageGrabbed += (sender, eventArgs) =>
            {
                var currentFrame = capture.RetrieveGrayFrame();
                framesQueue.Enqueue(currentFrame);
            };

我尝试了许多不同的格式和编解码器,例如.mov、.avi.mp4。我还尝试将 emgucv 更新到 3.0 版。当我尝试读取图像文件时,它甚至不起作用。我还确保我拥有所有的二进制文件和.dll文件。我看到了opencv_ffmpeg300.dll的所有解决方案,并确保我也拥有这些解决方案。

这是我得到的完整错误;

An unhandled exception of type 'System.NullReferenceException' occurred in Emgu.CV.dll Additional information: Unable to create capture from ModelsVideosvideo.MOV

任何帮助将不胜感激!

尝试提供视频文件夹的完整路径,如下所示

var modelVideos = Directory.GetFiles(@"c:ModelsVideos", "*.MOV");//full path to the videos folder.

相关内容

最新更新