Thursday, April 14, 2011

Camera Face Detection in C# Using Emgu CV (OpenCV in .NET) and WPF

The page has moved to a new location!
Click here to see the content:

Get the latest tutorial from me in my new blog:

Thank You for your attention and support :)


17 comments:

  1. awesome. thanks.

    ReplyDelete
  2. you're welcome.
    Come to see again to read my new tutorial :D

    ReplyDelete
  3. Thanks for the code and explanation, but whenever I try to run the code I get this error, do you have any Idea how to solve it?
    The error
    "Warning 1 Method, operator, or accessor 'RTSS_A.MainWindow.DeleteObject(System.IntPtr)' is marked external and has no attributes on it. Consider adding a DllImport attribute to specify the external implementation. C:\Users\A_00\Documents\Visual Studio 2010\Projects\RTSS_A\RTSS_A\MainWindow.xaml.cs 54 21 RTSS_A
    "

    ReplyDelete
  4. make sure you add this code before you call DeleteObject() function (see the last code snipet above):

    [DllImport("gdi32")]
    private static extern int DeleteObject(IntPtr o);

    ReplyDelete
  5. When I run this, I get a white background and nothing in it any idea of what is that cause? When I close it I get "The type initializer for 'Emgu.CV.CvInvoke' threw an exception."
    Thanks for your efforts.

    ReplyDelete
  6. @Ahmed Abdelgelil:

    make sure all opencv_xxxx.dll files and haarcascade_frontalface_alt_tree.xml in the same directory with your executable file. You can find those files inside C:\Emgu\emgucv-windows-x86 2.2.1.1150\bin

    Thank you :)

    ReplyDelete
  7. great job..can u help me to detect eyes using haarcascadeeye...

    ReplyDelete
  8. @anonymous: thanks. I plan to post about eye detection soon. Please wait for it :)

    ReplyDelete
  9. hi Junian,

    I get 'Emgu.CV.CvInvoke' threw an exception. how do i solve it?

    i don't understand where do i put my opencv_xxxx.dll files and haarcascade_frontalface_alt_tree.xml file inside which folder... is it my project folder or?

    Frank.

    ReplyDelete
  10. @Frank

    Just put opencv_xxxx.dll files and haarcascade_frontalface_alt_tree.xml in bin/Debug or bin/Release folder to solve your problem.

    If the problem still continue, please comment here

    Thanks

    ReplyDelete
  11. Thank you very much! it solved! =D. But got any way to improve the frame per seconds?

    Frank

    ReplyDelete
  12. @Frank

    I'm glad It solved :)
    I'm still working on it to improve fps

    ReplyDelete
  13. hey jun.
    i got some error like these :

    "An unhandled exception of type 'System.DllNotFoundException' occurred in Emgu.CV.dll

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

    what can i do to solve this?

    :D
    -Rieki-

    ReplyDelete
  14. @Rieki

    make sure opencv_xxxx.dll files and haarcascade_frontalface_alt_tree.xml in bin/Debug or bin/Release folder to solve your problem.

    If the problem still continue, please comment here. But, I think your problem is already solved :D

    ReplyDelete
  15. I've same problem....Files are in both folders.
    I've this exception:
    Impossibile caricare la DLL 'cvextern': Impossibile trovare il modulo specificato. (Eccezione da HRESULT: 0x8007007E).

    ReplyDelete
  16. You are Great!
    thanks you
    and please, if you have a(" Face Recognition ")

    please guide us
    thanks

    ReplyDelete
  17. @xgeneralex:
    any other error message? I can't clearly understand your problem

    @Anonymous:
    thanks, I'd like to make face recognition tutorial. Just wait for it :)

    ReplyDelete

Leave your comments here