Loading

Face Detection Concept in C#

Submitted by: 
Language: 
Visitors have accessed this post 39980 times.


This sample code provides you the concept on how image processing is done and manipulated using EmguCV. One good example of image processing is FACE and Object DETECTION and RECOGNITION etc. but in this sample code I only give Face detection and Eyes detection concept. I Hope you guys, you appreciate and love this work..

In order to work this program:

1.) I never use any SDK for this.. I just use EMGU CV for Image processing and Vision library.

2.) There is the so called COMPATIBILITY ISSUE when running and compiling this program... This program is compile in the Windows XP SP3 32-Bit OS. Therefore this program runs only on Windows XP.

Note:
when you compile and run this in the Windows 7 32 or 64-Bit OS, this program will commit an error on "cvextern.dll" why? because of the compatibility issue which is this program is compile under Windows XP.

Solution:
1.) Download the latest EMGU CV, then run and compile it under your OS Compatibility. After compiling.. Copy the following DLL and paste it in the folder where you save this program.
*cvextern.dll
*Emgu.CV.dll
*Emgu.CV.ML.dll
*Emgu.CV.UI.dll
*Emgu.Util.dll
*opencv_calib3d220.dll
*opencv_contrib220.dll
*opencv_core220.dll
*opencv_features2d220.dll
*opencv_ffmpeg220.dll
*opencv_flann220.dll
*opencv_gpu220.dll
*opencv_highgui220.dll
*opencv_imgproc220.dll
*opencv_legacy220.dll
*opencv_ml220.dll
*opencv_objdetect220.dll
*opencv_video220.dll

2.) Download the latest SQLite connector for .Net IDE (System.Data.SQLite.dll)

Thank you and Good Day...

Philip Cesar B. Garay
BSIT
Mindanao State University at Naawan
Naawan Misamis Oriental
9023 Philippines




Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. After downloading it, you will need a program like Winzip to decompress it.

Virus note: All files are scanned once-a-day by SourceCodester.com for viruses, but new viruses come out every day, so no prevention program can catch 100% of them.

FOR YOUR OWN SAFETY, PLEASE:

1. Re-scan downloaded files using your personal virus checker before using it.
2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.

Comments

sir eto po yung need namin sa thesis, possible po ba na ma convert ito sa vb6? salamat ng marami sir!

itachi_philip's picture

ahmm... parang impossible na mangyari ung wish mo kasi sa gamit ko pa lang na Emgu CV para sa face detection and recognition is pure C# wrapper yan and also I use XML for face detection like the frontal face, eye detection and profile face... so therefore parang malabo na mangyari yun....

This time I already created a Payroll System with Face recognition as the basis for the time attendance using C#...

Philip Cesar B. Garay BSIT
Mindanao State University at Naawan

[email protected]
NIT Software Lab

Hi im interested in ur work.. May i know how does it works po??this is my facebook acct. [email protected]. tnx ng madame! :))

sir i need finger print recongnition project in c sharp.if u will help me then i will be very thank full to u

itachi_philip's picture

Sorry... but I don't have that kind of project. Maybe there are lots of Fingerprint SDK out there in the internet... try to visit neurotechnology.com they offer free biometric SDK...

Philip Cesar B. Garay BSIT
Mindanao State University at Naawan

[email protected]
NIT Software Lab

I'm lester, can I have your number or add you in facebook or yahoo messenger to have conversation about C# and Visual Basic.

I have lots of question in programming.
I'm newbie in programming and I'm confused a little bit in programming and whats the best programming language to use.

Mr. Itachi add me [email protected]
Thx

itachi_philip's picture

Hello, I already add you in my facebook account, we can talk there or you can post here if you are in need. We have here our fellow programmers who kind to help you in your problem.

Philip Cesar B. Garay BSIT
Mindanao State University at Naawan

[email protected]
NIT Software Lab

How it's works ? in addition to compile your sample code , is there any SDK for this recognition system ? I've compile it at Visual C# 2010 and it wasn't work ... any idea pal ? I'm really very very very appreciate what you do ... thank's before ... best regard Andika fro Indonesia ...

itachi_philip's picture

In order to work this program:

1.) I never use any SDK for this.. I just use EMGU CV for Image processing and Vision library.

2.) There is the so called COMPATIBILITY ISSUE when running and compiling this program... This program is compile in the Windows XP SP3 32-Bit OS. Therefore this program runs only on Windows XP.

Note:
when you compile and run this in the Windows 7 32 or 64-Bit OS, this program will commit an error on "cvextern.dll" why? because of the compatibility issue which is this program is compile under Windows XP.

Solution:
1.) Download the latest EMGU CV, then run and compile it under your OS Compatibility. After compiling.. Copy the following DLL and paste it in the folder where you save this program.
*cvextern.dll
*Emgu.CV.dll
*Emgu.CV.ML.dll
*Emgu.CV.UI.dll
*Emgu.Util.dll
*opencv_calib3d220.dll
*opencv_contrib220.dll
*opencv_core220.dll
*opencv_features2d220.dll
*opencv_ffmpeg220.dll
*opencv_flann220.dll
*opencv_gpu220.dll
*opencv_highgui220.dll
*opencv_imgproc220.dll
*opencv_legacy220.dll
*opencv_ml220.dll
*opencv_objdetect220.dll
*opencv_video220.dll

2.) Download the latest SQLite connector for .Net IDE (System.Data.SQLite.dll)

Philip Cesar B. Garay BSIT
Mindanao State University at Naawan

[email protected]
NIT Software Lab

hi philip can you give me some suggestions on how to improve n to take intrest in programming and which programming will be suitable for new programmers like me and how could I a good programmer like you please give me some tips....

regards,
Zohaib Ud
[email protected]

kuya pa add nmn po aq fb oh ppturo dn sana ako sau :( pls po heres my email po [email protected]

dear sis,
I download (face_and_eye_detection_concept.zip) source code.
But I can't extract Zip file.
How can I do it?
give me suggestion please.
thank
Thein Than Soe.

itachi_philip's picture

Use Winrar software to extract that system...

Philip Cesar B. Garay BSIT
Mindanao State University at Naawan

[email protected]
NIT Software Lab

please send to me (face_and_eye_detection_concept.zip) source code in C#
[email protected]

itachi_philip's picture

There is already a link above and the link contains already the source code... just click and download it...

Philip Cesar B. Garay BSIT
Mindanao State University at Naawan

[email protected]
NIT Software Lab

sir, I want (face_and_eye_detection_concept.zip) source code.
Why download Zip file can not extract?
How can I get it.?

itachi_philip's picture

Use Winrar software to extract the file....

Philip Cesar B. Garay BSIT
Mindanao State University at Naawan

[email protected]
NIT Software Lab

hello sir,

I need help regarding -

1. Key code file.
2. if we bypass the key code, face is not appearing at picture box.

hi..u have OCR project? i need to do OCR project for my final project

s dis database related?

hi,In your code i have this exception DllNotFountException in the given line haar = new HaarCascade("haarcascade_frontalface_alt_tree.xml");
what should i do? please help.

itachi_philip's picture

Solution:
If you are using Visual Studio 2010.. then you must download the latest EMGU CV then compile it under the .NET FRAMEWORK 4... otherwise if you are using Visual Studio 2008 then compile my app.. under the .NET FRAMEWORK 3.5 or 2

Philip Cesar B. Garay BSIT
Mindanao State University at Naawan

[email protected]
NIT Software Lab

please give answer for all the question asked

how can i create using vb.net???

var faces =
grayframe.DetectHaarCascade(
haar, 1.4, 4,
HAAR_DETECTION_TYPE.DO_CANNY_PRUNING,
new Size(nextFrame.Width / 8, nextFrame.Height / 8)
)[0];

I'm having a problem with this code.. error says "Object reference not set to an instance of an object."

what should I do? Thanks

"Unable to load DLL 'cvextern': The specified module could not be found. (Exception from HRESULT: 0x8007007E)"

I have that error when I try to run the program.

private void Form1_Load(object sender, EventArgs e)
{
cap = new Capture(0);
// adjust path to find your xml
//haar = new HaarCascade("haarcascade_frontalface_alt2.xml");
//haar = new HaarCascade("haarcascade_frontalface_alt_tree.xml");
//eye= new HaarCascade("haarcascade_eye.xml");
haar = new HaarCascade("haarcascade_frontalface_alt2.xml");
}
at that line.

What should I do? Thak you very much

hello., am charmaine my problem is, i have already done the emguCV file..then already captured done everything and also the database record . i use VISUAL studio 2008 then mysql but the problem is . how can i connect to emgucv to sql so that every captured of the STUDent will see his/her record.. can you help ..it's my pressure.. this my facebook account: CHARMAINE JOYCE MENDOZA ISIDORO..

Hi, i ve some problems, when I follow your steps,
1º I downloaded Emgu CV, and i installed
2º I Add the references...for example Emgu.CV.ML.dll, is not there...I can not add
3º when i try to run it, in the line:
cap = new Capture(0);

A new window opens: TypeInitilizationException was un handled

Waht can I do??

Thank you so much for this post.

hey i want this project in vb.net 2008 please help me........[email protected] ...send me fast

sir,when i run the project only the form open and camera open .
after that nothing was happen.
so how can this project match or recognise the image

hello im ric, im about to give proposal concerning also in image processing,, my project is about traffic system using image processing, is it posible to identify congested traffic?

you dont know how this thing works.

What is the Microsft.CSharp?!

Add new comment

(If you're a human, don't change the following field)
Your first name.
(If you're a human, don't change the following field)
Your first name.
(If you're a human, don't change the following field)
Your first name.

Filtered HTML

  • You may insert videos with [video:URL]
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <asp>, <c>, <cpp>, <csharp>, <css>, <html4strict>, <java>, <javascript>, <mysql>, <php>, <python>, <sql>, <vb>, <vbnet>. The supported tag styles are: <foo>, [foo].
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.