N/APosted on - 12/01/2013
I need to add facial recognition facility for a system that I am currently developing but I don't know how and I would like to know how to do it using C#.NET. I need to know what are the additional libraries needed to be added and some sample script how it is done.
How to create facial recognition system using C#?
Face Detection tends to be complex since you will be dealing with a lot of variations and image distinction. However, you can integrate some algorithm and data structure to be able to provide quality results. To know more about face detection using C#, kindly click the link below.
Face detection using C# – This link will guide you through the online tutorial on how to create facial recognition segments. Also, the article provides sample codes to review and analyze.
In addition, kindly review and study the sample source code for face recognition below.
public int FaceDetection(Form1 Main, PictureBox PicFirst,
PictureBox Picresult,TextBox TWskin,PictureBox face,TextBox TBskin)
Testdetection = 0;
Graphics hh = PicFirst.CreateGraphics();
Bitmap PreResult = new Bitmap(PicFirst.Image);
Bitmap Result = new Bitmap(PicFirst.Width, Picresult.Height);
Bitmap HisResult = new Bitmap(PicFirst.Width, Picresult.Height);
Bitmap Template50 = new Bitmap("sample50.bmp");
Bitmap Template25 = new Bitmap("sample25.bmp");
Bitmap facee = new Bitmap(face.Width, face.Height);
for (int i = 0; i < PicFirst.Width; i++)
for (int j = 0; j < PicFirst.Height; j++)
//Getting red layer
R = PreResult.GetPixel(i, j).R;
//Getting green layer
G = PreResult.GetPixel(i, j).G;
//Getting blue layer
B = PreResult.GetPixel(i, j).B;
//Formula for convert RGB 2 YCBCR
//Y = 0.299 * R + 0.587 * G + 0.114 * B;
//Cb = -0.169*R – 0.332*G + 0.500*B;
Cr = 0.500 * R – 0.419 * G – 0.081 * B;
//Ckeck for "-" values(Because we can't use "-" values for RGB color)
if (Cr < 0)
//Convert to Positive values
HisResult.SetPixel(i, j, Color.FromArgb((int)Cr, (int)Cr, (int)Cr));