【问题标题】:emgucv won't read video/image files, getting an System.NullReferenceException erroremgucv 不会读取视频/图像文件,出现 System.NullReferenceException 错误
【发布时间】:2016-07-05 20:37:50
【问题描述】:

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

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 ModelsVideos\video.MOV

任何帮助将不胜感激!

【问题讨论】:

    标签: video emgucv


    【解决方案1】:

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

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-10-21
      • 2018-11-13
      • 1970-01-01
      • 1970-01-01
      • 2021-07-22
      • 1970-01-01
      • 2023-03-30
      • 1970-01-01
      相关资源
      最近更新 更多