I am doing a face recognition project, and i want to compare the x.label returned value with the saved ID into the database. I always get an error in IF condition comparing the ID with the x.label
public int Predict(Image<Gray, Byte> testImage)
{
Emgu.CV.FaceRecognizer.PredictionResult x;
if (testImage != null)
{
x = fr.Predict(testImage);
pictureBox1.Image = testImage.ToBitmap();
//MessageBox.Show(x.Label.ToString()+" "+x.Distance.ToString());
if (x.Distance < 69)
return x.Label;
else
MessageBox.Show("Error!!, The detected Face is neither recognised nor enrolled");
return -1;
D1 = new OleDbDataAdapter("Select [ID] FROM [connect]", DBConnection);
if (ID == x.Label)
{
OleDbCommand insert1 = new OleDbCommand("Insert INTO OutputReprt (Attendance) values (yes)", DBConnection);
}
Aucun commentaire:
Enregistrer un commentaire