【问题标题】:EmguCv EigenObjectRecognizer creating instanceEmguCv EigenObjectRecognizer 创建实例
【发布时间】:2017-07-24 04:17:10
【问题描述】:

我的应用程序在创建 EigenObjectRecognizer 类的识别器对象时关闭而没有给出任何错误或警告,是我传递了错误的参数还是有其他问题?这是我的代码

 string[] allFaces = Directory.GetFiles(savepath);
            if (allFaces != null)
            {


                Image<Gray, Byte>[] trainingImages = new Image<Gray, Byte>[allFaces.Length];
                string[] labels = new String[allFaces.Length];

                for (int i = 0; i < allFaces.Length; i++)
                {
                    trainingImages[i]  = new Image<Gray, byte>(new Bitmap(allFaces[i]));
                    labels[i] = allFaces[i].Substring(allFaces[i].LastIndexOf("\\")+1);
                }


                MCvTermCriteria termCrit = new MCvTermCriteria(allFaces.Length, 0.001);

                EigenObjectRecognizer recognizer = new EigenObjectRecognizer(
                   trainingImages,
                   labels,
                   1000,
                     ref termCrit);



                Image<Gray, Byte> testImage = new Image<Gray, Byte>(@"C:\..test\1");

                string label = recognizer.Recognize(testImage).Label;
                MessageBox.Show(label);
            }

【问题讨论】:

    标签: c# emgucv


    【解决方案1】:

    通过从编译的 exe 的原始运行中获取错误解决了该问题,该错误给出了来自 opencv 而不是 emgucv 的输入大小不同的错误。当我查看我的训练图像时,它们的大小不同。希望对其他人有所帮助

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-04-16
      • 2018-01-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多