Emgu c#, how to train list of Image<Gray, byte> in the current latest version?

Viewed 29

I have the following code

         var files = Directory.GetFiles("./Folder/Of/Images", "*.png");

         var trainedFaces = new List<Image<Gray, byte>>();

         foreach (var f in files)
         {
             var trainedImage = new Image<Gray, byte>(f);
             trainedFaces.Add(trainedImage);
         }


         EigenFaceRecognizer recognizer = new EigenFaceRecognizer(trainedFaces.Count, Threshold);

         recognizer.Train(trainedFaces, Enumerable.Range(1, trainedFaces.Count).ToArray());

from the tutorials that I watch this compiles for them but not for me because I use the latest version of Emgu for .net 6, this line

         recognizer.Train(trainedFaces, Enumerable.Range(1, trainedFaces.Count).ToArray());

causes the problem, it says cannot convert from 'System.Collections.Generic.List<Emgu.CV.Image<Emgu.CV.Structure.Gray, byte>>' to 'Emgu.CV.IInputArray' how do I make this work for the current version of Emgu? I literally have been searching this for hours but most would say it would compile since they use older versions of Emgu but I need the latest version since I'm forced to use .net 6

0 Answers
Related