title: 'Emgu.CV.Util.CvException' occurred in 'Emgu.CV.World.dll' - When trying to Predict
body: <p>I am developing a face recognition application usin <strong><em>EmguCV 3.1</em></strong>. And I am using EigenFaceRecognizer as the recognition algorithm. I tried to train an image using the code below.</p>
  
  <pre><code>    List&lt;Image&lt;Gray, byte&gt;&gt; trainingImages = new List&lt;Image&lt;Gray, byte&gt;&gt;();
      FaceRecognizer recognizer;
      List&lt;Face&gt; faceList = new List&lt;Face&gt;();
          ...
          ...
          recognizer = new EigenFaceRecognizer(80, double.PositiveInfinity);
          ...
          ...            
          Image&lt;Gray, byte&gt; image = new Image&lt;Gray, byte&gt;(imgBox2.DisplayedImage.Bitmap);
          trainingImages.Add(image);
          List&lt;int&gt; trainigLabels = new List&lt;int&gt;();
          recognizer.Train(trainingImages.ToArray(), trainigLabels.ToArray());
          recognizer.Save("TraningData");
          faceList.Add(new Face(image.Bytes.Length, txtName.Text));
          ...
          ...
          Image&lt;Gray, byte&gt; image = new Image&lt;Gray, byte&gt;(imgBox2.DisplayedImage.Bitmap);
              recognizer.Load("TraningData");
              try
              {
                  var result = recognizer.Predict(image);
                  MessageBox.Show(result.Label.ToString());
              }
              catch (Emgu.CV.Util.CvException ex)
              {
                  Console.WriteLine(ex);
              }
  </code></pre>
  
  <p>But when this code is invoked it gives me following error. </p>
  
  <pre><code>A first chance exception of type 'Emgu.CV.Util.CvException' occurred in Emgu.CV.World.dll
  The program '[1136] IPTest.vshost.exe' has exited with code -1073741819 (0xc0000005) 'Access violation'.
  The program '[1136] IPTest.vshost.exe: Program Trace' has exited with code 0 (0x0).
  </code></pre>
  
  <p>It is occurring while trying to use <code>recognizer.Train()</code>. What have I done wrong?</p>
  
  <p><strong>UPDATE</strong><br>
  After some trial and error I got to know that problem is with recognizer.Predict() method. <br>
  When I used try/catch it shows the following exception</p>
  
  <pre><code>Emgu.CV.Util.CvException: OpenCV: The matrix is not continuous, thus its number of rows can not be changed
  </code></pre>