title: An unhandled exception of type 'System.IO.FileNotFoundException' occurred in InAirSignature.exe
body: <p>I am doing a program with Emgu.CV in C#</p>
  
  <p>and i receive this error when compiling </p>
  
  <blockquote>
    <p>An unhandled exception of type 'System.IO.FileNotFoundException'
    occurred in InAirSignature.exe</p>
    
    <p>Additional information: Could not load file or assembly 'Emgu.CV.UI,
    Version=2.9.0.1922, Culture=neutral, PublicKeyToken=7281126722ab4438'
    or one of its dependencies. The system cannot find the file specified.</p>
  </blockquote>
  
  <p>any ideas how to solve?
  for my coding, a webcam is needed.
  below is my coding.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>using System;
  using System.Collections.Generic;
  using System.ComponentModel;
  using System.Data;
  using System.Drawing;
  using System.Linq;
  using System.Text;
  using System.Threading.Tasks;
  using System.Windows.Forms;
  using Emgu.CV;
  using Emgu.CV.GPU;
  using Emgu.Util;
  using Emgu.CV.Structure;
  using Emgu.CV.UI;
  using Emgu.CV.CvEnum;
  using System.Diagnostics;
  using System.Windows.Forms.DataVisualization.Charting;
  using Emgu.CV.ML.Structure;
  using Emgu.CV.ML;
  using System.IO;
  
  namespace InAirSignature
  {
      public partial class Main : Form
      {
          private Capture capture;
          private Rectangle roi;
          private Bgr redOrGreen;
  
          private const int NUMBERS_OF_FRAMES = 90,
                            NUMBERS_OF_SIGN = 6,
                            NUMBERS_OF_FEATURES = 3, // X Y Averange
                            FEATURE_X = 0,
                            FEATURE_Y = 1,
                            TEST = NUMBERS_OF_SIGN - 1,
                            NUMBERS_OF_NEURONS = 15;
  
          private const int frameHeight = 640;
          private const int frameWidth = 480;
  
          private List&lt;Image&lt;Gray, Byte&gt;&gt; imgGrayBuffer = new List&lt;Image&lt;Gray, Byte&gt;&gt;();
          private List&lt;int&gt; pointX = new List&lt;int&gt;();
          private List&lt;int&gt; pointY = new List&lt;int&gt;();
  
          private int[][][] pointsOfSign, distanceBetweenPoints;
          private double[] finalAverage;
          private int[][] pointsOfSignReference;
          private int[] distanceBetweenPointsForRefenceAndTest;
  
          private int[] classes = {0,0,0,0,1,1,1,1,1,1};
  
          private int resultMode = 0;
          private int recordSign = 0;
          private bool record = false;
          private int counter = 0;
  
          private Stopwatch stopWatch;
  
          private const string SYSTEM_MESSAGE = "System Message: ",
                               WELCOME_MESSAGE = "Welcome! ";
  
          Matrix&lt;int&gt; layerSize;
          MCvANN_MLP_TrainParams parameters;
          ANN_MLP network;
  
          //////////////////////////////////////////////////////////////////////////////////////////////////////////
          /////////////////////                              Form                              ///////////////////// 
          //////////////////////////////////////////////////////////////////////////////////////////////////////////
  
          #region Form
          public Main()
          {
              InitializeComponent();
  
              #region Initialize graph
              chartX.Series.Add("X1");
              chartX.Series.Add("X2");
              chartX.Series.Add("X3");
              chartX.Series.Add("X4");
              chartX.Series.Add("X5");
              chartX.Series.Add("Xtest");
              chartX.Series.Add("Xref");
              chartY.Series.Add("Y1"); 
              chartY.Series.Add("Y2");
              chartY.Series.Add("Y3");
              chartY.Series.Add("Y4");
              chartY.Series.Add("Y5");
              chartY.Series.Add("Ytest");
              chartY.Series.Add("Yref");
              chartX.Series["X1"].Color = Color.Blue;
              chartX.Series["X2"].Color = Color.Green;
              chartX.Series["X3"].Color = Color.Red;
              chartX.Series["X4"].Color = Color.Pink;
              chartX.Series["X5"].Color = Color.Purple;
              chartX.Series["Xtest"].Color = Color.Aqua;
              chartX.Series["Xref"].Color = Color.BlueViolet;
              chartY.Series["Y1"].Color = Color.Blue;
              chartY.Series["Y2"].Color = Color.Green;
              chartY.Series["Y3"].Color = Color.Red;
              chartY.Series["Y4"].Color = Color.Pink;
              chartY.Series["Y5"].Color = Color.Purple;
              chartY.Series["Ytest"].Color = Color.Aqua;
              chartY.Series["Yref"].Color = Color.BlueViolet;
              chartX.Series["X1"].ChartType = SeriesChartType.FastLine;
              chartX.Series["X2"].ChartType = SeriesChartType.FastLine;
              chartX.Series["X3"].ChartType = SeriesChartType.FastLine;
              chartX.Series["X4"].ChartType = SeriesChartType.FastLine;
              chartX.Series["X5"].ChartType = SeriesChartType.FastLine;
              chartX.Series["Xtest"].ChartType = SeriesChartType.FastLine;
              chartX.Series["Xref"].ChartType = SeriesChartType.FastLine;
              chartY.Series["Y1"].ChartType = SeriesChartType.FastLine;
              chartY.Series["Y2"].ChartType = SeriesChartType.FastLine;
              chartY.Series["Y3"].ChartType = SeriesChartType.FastLine;
              chartY.Series["Y4"].ChartType = SeriesChartType.FastLine;
              chartY.Series["Y5"].ChartType = SeriesChartType.FastLine;
              chartY.Series["Ytest"].ChartType = SeriesChartType.FastLine;
              chartY.Series["Yref"].ChartType = SeriesChartType.FastLine;
              #endregion
  
              #region Initialize Neural Network
              layerSize = new Matrix&lt;int&gt;(new int[] { NUMBERS_OF_FEATURES, NUMBERS_OF_NEURONS, 1 });
              parameters = new MCvANN_MLP_TrainParams();
              parameters.term_crit = new MCvTermCriteria(10, 1.0e-8);
              parameters.train_method = Emgu.CV.ML.MlEnum.ANN_MLP_TRAIN_METHOD.BACKPROP;
              parameters.bp_dw_scale = 0.1;
              parameters.bp_moment_scale = 0.1;
              network = new ANN_MLP(layerSize, Emgu.CV.ML.MlEnum.ANN_MLP_ACTIVATION_FUNCTION.SIGMOID_SYM, 1.0, 1.0);
              #endregion
  
              #region Initialize camera
              capture = new Capture();
              capture.SetCaptureProperty(Emgu.CV.CvEnum.CAP_PROP.CV_CAP_PROP_FRAME_HEIGHT, frameHeight);
              capture.SetCaptureProperty(Emgu.CV.CvEnum.CAP_PROP.CV_CAP_PROP_FRAME_WIDTH, frameWidth);
              #endregion
  
              initializeData();  
  
              roi = new Rectangle(338, 2, 300, 300);
              redOrGreen = new Bgr(Color.Red);
              lblSM.Text = SYSTEM_MESSAGE + WELCOME_MESSAGE;
              updateResult();
              updateGraph();
              Application.Idle += processFrame;
          }
  
          private void Form1_FormClosing(object sender, FormClosingEventArgs e)
          {
              capture.Stop();
          }
          #endregion
  
          //////////////////////////////////////////////////////////////////////////////////////////////////////////
          /////////////////////                             Button                             /////////////////////
          //////////////////////////////////////////////////////////////////////////////////////////////////////////
  
          #region Button
          private void btnSign_Click(object sender, EventArgs e)
          {
              stopWatch = Stopwatch.StartNew();
              record = true;
              redOrGreen = new Bgr(Color.LightGreen);
  
              if (sender == btnSign1)
                  recordSign = 1;
              else if (sender == btnSign2)
                  recordSign = 2;
              else if (sender == btnSign3)
                  recordSign = 3;
              else if (sender == btnSign4)
                  recordSign = 4;
              else if (sender == btnSign5)
                  recordSign = 5;
              else
                  recordSign = 6;
          }
  
          private void btnPredict_Click(object sender, EventArgs e)
          {
              float predicted = predict(new int[,] { { distanceBetweenPointsForRefenceAndTest[0], distanceBetweenPointsForRefenceAndTest[1], distanceBetweenPointsForRefenceAndTest[2] } }, network);
              string result;
              if (predicted &lt; Convert.ToDouble(lblThreshold.Text))
                  result = "Success";
              else
                  result = "Fail";
              lblSM.Text = SYSTEM_MESSAGE + "Matching result - " + result + ", value: " + predicted.ToString();
          }
  
          private void btnSave_Click(object sender, EventArgs e)
          {
              try
              {
                  if (tbId.Text == "")
                      throw new Exception();
                  saveSignReference();
                  network.Save(tbId.Text);
                  lblSM.Text = SYSTEM_MESSAGE + "Saved";
              }
              catch
              {
                  lblSM.Text = SYSTEM_MESSAGE + "ID blank";
              }
          }
  
          private void btnLoad_Click(object sender, EventArgs e)
          {
              try
              {
                  if (tbId.Text == "")
                      throw new Exception();
                  loadSignReference();
                  network.Load(tbId.Text);
                  lblSM.Text = SYSTEM_MESSAGE + "Loaded";
                  btnVerify.Enabled = true;
                  btnSave.Enabled = true;
                  cbAuto.Enabled = true;
                  updateGraph();
              }
              catch
              {
                  lblSM.Text = SYSTEM_MESSAGE + "Invalid ID";
              }
          }
  
          private void btnTrainNN_Click(object sender, EventArgs e)
          {
              btnVerify.Enabled = true;
              btnSave.Enabled = true;
              cbAuto.Enabled = true;
              trainNN();
          }
  
          private void btnClear_Click(object sender, EventArgs e)
          {
              initializeData();
              updateGraph();
              updateResult();
              calculateResult();
              rbS1.PerformClick();
          }
          #endregion
  
          //////////////////////////////////////////////////////////////////////////////////////////////////////////
          /////////////////////                            Check Box                           ///////////////////// 
          //////////////////////////////////////////////////////////////////////////////////////////////////////////
  
          #region Check Box
          private void cbBinaryImage_CheckedChanged(object sender, EventArgs e)
          {
              ibBinaryImage.Visible = !ibBinaryImage.Visible;
          }
  
          private void cbResult_CheckedChanged(object sender, EventArgs e)
          {
              pnlResult.Visible = !pnlResult.Visible;
          }
  
          private void cbSign_CheckedChanged(object sender, EventArgs e)
          {
              if (sender == cbSign1)
              {
                  chartX.Series["X1"].Enabled = !chartX.Series["X1"].Enabled;
                  chartY.Series["Y1"].Enabled = !chartY.Series["Y1"].Enabled;
              }
              else if (sender == cbSign2)
              {
                  chartX.Series["X2"].Enabled = !chartX.Series["X2"].Enabled;
                  chartY.Series["Y2"].Enabled = !chartY.Series["Y2"].Enabled;
              }
              else if (sender == cbSign3)
              {
                  chartX.Series["X3"].Enabled = !chartX.Series["X3"].Enabled;
                  chartY.Series["Y3"].Enabled = !chartY.Series["Y3"].Enabled;
              }
              else if (sender == cbSign4)
              {
                  chartX.Series["X4"].Enabled = !chartX.Series["X4"].Enabled;
                  chartY.Series["Y4"].Enabled = !chartY.Series["Y4"].Enabled;
              }
              else if (sender == cbSign5)
              {
                  chartX.Series["X5"].Enabled = !chartX.Series["X5"].Enabled;
                  chartY.Series["Y5"].Enabled = !chartY.Series["Y5"].Enabled;
              }
              else if (sender == cbSignRefer)
              {
                  chartX.Series["Xref"].Enabled = !chartX.Series["Xref"].Enabled;
                  chartY.Series["Yref"].Enabled = !chartY.Series["Yref"].Enabled;
              }
              else 
              {
                  chartX.Series["Xtest"].Enabled = !chartX.Series["Xtest"].Enabled;
                  chartY.Series["Ytest"].Enabled = !chartY.Series["Ytest"].Enabled;
              }
          }
          #endregion
  
          //////////////////////////////////////////////////////////////////////////////////////////////////////////
          /////////////////////                          Radio Button                          /////////////////////
          //////////////////////////////////////////////////////////////////////////////////////////////////////////
  
          #region Radio Button
          private void rbS_CheckedChanged(object sender, EventArgs e)
          {
              if (sender == rbS1)
                  resultMode = 0;
              else if (sender == rbS2)
                  resultMode = 1;
              else if (sender == rbS3)
                  resultMode = 2;
              else if (sender == rbS4)
                  resultMode = 3;
              else
                  resultMode = 4;
  
              updateResult();
          }
          #endregion
  
          //////////////////////////////////////////////////////////////////////////////////////////////////////////
          /////////////////////                            Text Box                            /////////////////////
          //////////////////////////////////////////////////////////////////////////////////////////////////////////
  
          #region Text Box
          private void tbId_KeyUp(object sender, KeyEventArgs e)
          {
              if (e.KeyCode == Keys.Enter)
                  btnLoad.PerformClick();
          }
          #endregion
  
          //////////////////////////////////////////////////////////////////////////////////////////////////////////
          /////////////////////                            Function                            /////////////////////
          //////////////////////////////////////////////////////////////////////////////////////////////////////////
  
          private void processFrame(object sender, EventArgs arg)
          {
              Image&lt;Bgr, Byte&gt; frame = capture.QueryFrame().Flip(FLIP.HORIZONTAL);
              Image&lt;Bgr, Byte&gt; frameCrop = frame.Copy(new Rectangle(338, 2, 300, 300));   // copy a crop
              Image&lt;Gray, Byte&gt; frameBinary;
  
              if (counter == (NUMBERS_OF_FRAMES - 2))
                  redOrGreen = new Bgr(Color.Red);
  
              frame.Draw(roi, redOrGreen, 2);
              frameBinary = ImageProcessing.getSkin(frameCrop);
  
              if (record == true)
              {
                  imgGrayBuffer.Add(frameBinary);
                  counter++;
  
                  if (counter == NUMBERS_OF_FRAMES)
                  {
                      while (imgGrayBuffer.Count() &gt; 0)
                      {
                          Point point = ImageProcessing.getHighestPoint(imgGrayBuffer.ElementAt(0));
                          imgGrayBuffer.RemoveAt(0);
                          pointX.Add(point.X);
                          pointY.Add(point.Y);
                      }
                      pointsOfSign[recordSign - 1][FEATURE_X] = pointX.ToArray();
                      pointsOfSign[recordSign - 1][FEATURE_X] = normalizeSize(pointsOfSign[recordSign - 1][FEATURE_X]);
                      pointsOfSign[recordSign - 1][FEATURE_X] = normalizePosition(pointsOfSign[recordSign - 1][FEATURE_X]);
                      pointsOfSign[recordSign - 1][FEATURE_Y] = pointY.ToArray();
                      pointsOfSign[recordSign - 1][FEATURE_Y] = normalizeSize(pointsOfSign[recordSign - 1][FEATURE_Y]);
                      pointsOfSign[recordSign - 1][FEATURE_Y] = normalizePosition(pointsOfSign[recordSign - 1][FEATURE_Y]);
  
                      pointX.Clear();
                      pointY.Clear();
                      calculateResult();
                      updateResult();
                      updateGraph();
                      record = false;
                      stopWatch.Stop();
                      lblSM.Text = SYSTEM_MESSAGE + "Time taken =&gt; " + stopWatch.Elapsed.TotalSeconds.ToString() + " seconds.";
                      if (cbAuto.Checked == true &amp;&amp; recordSign == 6)
                          btnVerify.PerformClick();
                      recordSign = 0;
                      counter = 0;
                  }
              }
  
              ibMain.Image = frame;
  
              if(cbBinaryImage.Checked == true)
                  ibBinaryImage.Image = frameBinary;
          }
  
          private int[] normalizePosition(int[] position)
          {
              int min = int.MaxValue,
                  max = int.MinValue;
              for (int i = 0; i &lt; position.Count(); i++)
              {
                  if (position[i] &gt; max)
                      max = position[i];
                  if (position[i] &lt; min)
                      min = position[i];
              }
              int midPoint = (min + max) / 2;
  
              for (int i = 0; i &lt; position.Count(); i++)
                  position[i] -= midPoint;
              return position;
          }
  
          private int[] normalizeSize(int[] position)
          {
              const int targetSize = 300;
              int min = int.MaxValue,
                  max = int.MinValue;
              for (int i = 0; i &lt; position.Count(); i++)
              {
                  if (position[i] &gt; max)
                      max = position[i];
                  if (position[i] &lt; min)
                      min = position[i];
              }
              int height = max - min;
              if (height != 0)
                  height = targetSize / height;
              for (int i = 0; i &lt; position.Count(); i++)
                  position[i] *= height;
              return position;
  
          }
  
          private void updateGraph()
          {
              foreach (var series in chartX.Series)
                  series.Points.Clear();
  
              foreach (var series in chartY.Series)
                  series.Points.Clear();
  
              for (int i = 0; i &lt; NUMBERS_OF_FRAMES; i++)
              {
                  chartX.Series["X1"].Points.AddXY
                                  (i, pointsOfSign[0][FEATURE_X][i]);
                  chartX.Series["X2"].Points.AddXY
                                  (i, pointsOfSign[1][FEATURE_X][i]);
                  chartX.Series["X3"].Points.AddXY
                                  (i, pointsOfSign[2][FEATURE_X][i]);
                  chartX.Series["X4"].Points.AddXY
                                  (i, pointsOfSign[3][FEATURE_X][i]);
                  chartX.Series["X5"].Points.AddXY
                                  (i, pointsOfSign[4][FEATURE_X][i]);
                  chartX.Series["Xref"].Points.AddXY
                                  (i, pointsOfSignReference[0][i]);
                  chartX.Series["Xtest"].Points.AddXY
                                  (i, pointsOfSign[5][FEATURE_X][i]);
              
                  chartY.Series["Y1"].Points.AddXY
                                  (i, pointsOfSign[0][FEATURE_Y][i]);
                  chartY.Series["Y2"].Points.AddXY
                                  (i, pointsOfSign[1][FEATURE_Y][i]);
                  chartY.Series["Y3"].Points.AddXY
                                  (i, pointsOfSign[2][FEATURE_Y][i]);
                  chartY.Series["Y4"].Points.AddXY
                                  (i, pointsOfSign[3][FEATURE_Y][i]);
                  chartY.Series["Y5"].Points.AddXY
                                  (i, pointsOfSign[4][FEATURE_Y][i]);
                  chartY.Series["Yref"].Points.AddXY
                                 (i, pointsOfSignReference[1][i]);
                  chartY.Series["Ytest"].Points.AddXY
                                  (i, pointsOfSign[5][FEATURE_Y][i]);
              }
          }
  
          private void calculateResult()
          {
              int average = 0;
  
              for (int i = 0; i &lt; NUMBERS_OF_SIGN - 1; i++)
                  for (int j = 0; j &lt; NUMBERS_OF_SIGN - 1; j++)
                  {
                      for (int k = 0; k &lt; NUMBERS_OF_FEATURES - 1; k++)
                      {
                          distanceBetweenPoints[i][j][k] = DTW.Distance(pointsOfSign[i][k], pointsOfSign[j][k]);
                          average += distanceBetweenPoints[i][j][k];
                      }
                      distanceBetweenPoints[i][j][NUMBERS_OF_FEATURES - 1] = average / 2;
                      average = 0;
                  }
  
              for (int i = 0; i &lt; NUMBERS_OF_SIGN -1; i++)
              {
                  finalAverage[i] = 0.0;
                  for (int j = 0; j &lt; NUMBERS_OF_SIGN; j++)
                      finalAverage[i] += distanceBetweenPoints[i][j][NUMBERS_OF_FEATURES - 1];
                  finalAverage[i] /= NUMBERS_OF_SIGN - 2;
              }
  
              average = 0;
              for (int k = 0; k &lt; NUMBERS_OF_FEATURES - 1; k++)
              {
                  distanceBetweenPointsForRefenceAndTest[k] = DTW.Distance(pointsOfSignReference[k], pointsOfSign[TEST][k]);
                  average += distanceBetweenPointsForRefenceAndTest[k];
              }
              distanceBetweenPointsForRefenceAndTest[NUMBERS_OF_FEATURES - 1] = average / 2;
          }
  
          private void updateResult()
          {
              tbResult1X.Text = distanceBetweenPoints[resultMode][0][0].ToString();
              tbResult1Y.Text = distanceBetweenPoints[resultMode][0][1].ToString();
              tbResult1A.Text = distanceBetweenPoints[resultMode][0][2].ToString();
              tbResult2X.Text = distanceBetweenPoints[resultMode][1][0].ToString();
              tbResult2Y.Text = distanceBetweenPoints[resultMode][1][1].ToString();
              tbResult2A.Text = distanceBetweenPoints[resultMode][1][2].ToString();
              tbResult3X.Text = distanceBetweenPoints[resultMode][2][0].ToString();
              tbResult3Y.Text = distanceBetweenPoints[resultMode][2][1].ToString();
              tbResult3A.Text = distanceBetweenPoints[resultMode][2][2].ToString();
              tbResult4X.Text = distanceBetweenPoints[resultMode][3][0].ToString();
              tbResult4Y.Text = distanceBetweenPoints[resultMode][3][1].ToString();
              tbResult4A.Text = distanceBetweenPoints[resultMode][3][2].ToString();
              tbResult5X.Text = distanceBetweenPoints[resultMode][4][0].ToString();
              tbResult5Y.Text = distanceBetweenPoints[resultMode][4][1].ToString();
              tbResult5A.Text = distanceBetweenPoints[resultMode][4][2].ToString();
              tbTotalA.Text = finalAverage[resultMode].ToString();
              tbRatX.Text = distanceBetweenPointsForRefenceAndTest[0].ToString();
              tbRatY.Text = distanceBetweenPointsForRefenceAndTest[1].ToString();
              tbRatA.Text = distanceBetweenPointsForRefenceAndTest[2].ToString();
          }
  
          private float predict(int[,] testingSetInt, ANN_MLP network)
          {
              Matrix&lt;float&gt; testingSet = new Matrix&lt;float&gt;(Utility.arrayIntToFloat(testingSetInt)),
                            prediction = new Matrix&lt;float&gt;(1, 1);
  
              network.Predict(testingSet, prediction);
              return prediction.Data[0, 0];
          }
  
          private ANN_MLP trainNN(int[] trainingClassesInt, int[,] trainingSetInt)
          {
              int numbers_of_training_set = 4,
                  numbers_of_data = trainingSetInt.GetUpperBound(0) + 1;
  
              Matrix&lt;float&gt; trainingSet = new Matrix&lt;float&gt;(Utility.arrayIntToFloat(trainingSetInt)),
                            trainingClasses = new Matrix&lt;float&gt;(Utility.arrayIntToFloat(trainingClassesInt));
  
              Matrix&lt;float&gt; trainingSetPositive = trainingSet.GetRows(0, numbers_of_training_set, 1);
              Matrix&lt;float&gt; trainingSetNegative = trainingSet.GetRows(numbers_of_training_set, numbers_of_data, 1);
  
              Matrix&lt;float&gt; trainClassesPositive = trainingClasses.GetRows(0, numbers_of_training_set, 1);
              Matrix&lt;float&gt; trainClassesNegative = trainingClasses.GetRows(numbers_of_training_set, numbers_of_data, 1);
  
              ANN_MLP network = new ANN_MLP(layerSize, Emgu.CV.ML.MlEnum.ANN_MLP_ACTIVATION_FUNCTION.SIGMOID_SYM, 1.0, 1.0);
              network.Train(trainingSet, trainingClasses, null, (Matrix&lt;int&gt;)null, parameters, Emgu.CV.ML.MlEnum.ANN_MLP_TRAINING_FLAG.DEFAULT);
  
              return network;
          }
  
          private void trainNN()
          {
              // Getting the most closest signature
              int index = 0;
  
              for (int i = 1; i &lt; NUMBERS_OF_SIGN - 1; i++)
                  if (finalAverage[index] &gt; finalAverage[i])
                      index = i;
  
              lblSM.Text = SYSTEM_MESSAGE + "Sign @ no." + (index + 1).ToString() + " is the reference now!";
  
              for (int i = 0; i &lt; NUMBERS_OF_FEATURES - 1; i++)
                  pointsOfSignReference[i] = pointsOfSign[index][i];
  
              int total_training_data = 10;   // 4 positive, 6 negative
              int total_features_for_training = 3; //  dtw of x, dtw of y, width of sign
              int[,] trainingSet = new int[total_training_data, total_features_for_training];
  
              // Get the distance (x and y) between closest signature and the rest of signature into training set 
              // Feature 0 and 1 =&gt; dtw of x, dtw of y
              for (int i = 0, current = 0; i &lt; NUMBERS_OF_SIGN - 1; i++)
              {
                  if (i != index)
                  {
                      for (int j = 0; j &lt; NUMBERS_OF_FEATURES; j++)
                          trainingSet[current, j] = distanceBetweenPoints[i][index][j];
                      current++;
                  }
              }
  
              // Generate negative data
              int[] max_value = new int[NUMBERS_OF_FEATURES];
              int[] min_value = new int[NUMBERS_OF_FEATURES];
              for (int i = 0; i &lt; NUMBERS_OF_SIGN - 1; i++)
              {
                  for (int j = 0; j &lt; NUMBERS_OF_FEATURES &amp;&amp; i != index; j++)
                  {
                      if (max_value[j] &lt; distanceBetweenPoints[i][index][j])
                          max_value[j] = distanceBetweenPoints[i][index][j];
                      if (min_value[j] &gt; distanceBetweenPoints[i][index][j])
                          min_value[j] = distanceBetweenPoints[i][index][j];
                  }
              }
  
              Random random = new Random();
  
             
  
    </code></pre>
  </div>
  </div>
  </p>