C# Tutorial - Webcam Face Detection for .NET using EMGU.CV in C# | FoxLearn

  Рет қаралды 50,759

Fox Learn

Fox Learn

Күн бұрын

Пікірлер
@koolooc726
@koolooc726 2 жыл бұрын
just a tip for anyone following this tutorial, I had a lot of problems when using the latest versions of EMGU, but then I tried the older versions, such as 3.2 and it worked just fine :3
@jabuszkodev
@jabuszkodev 2 жыл бұрын
System.TypeInitializationException HResult=0x80131534 Message=Inicjator typów zgłosił wyjątek dla typu 'Engine.Form1'. Source=Engine Ślad stosu: at Engine.Form1..ctor() in C:\Users\Alex\Desktop\Codes\Engine\Engine\Form1.cs:line 23 at Engine.Program.Main() in C:\Users\Alex\Desktop\Codes\Engine\Engine\Program.cs:line 19 Ten wyjątek został pierwotnie zgłoszony w tym stosie wywołań: [Kod zewnętrzny] Engine.Form1.Form1() w Form1.cs Wewnętrzny wyjątek 1: CvException: OpenCV: haarcascade_frontalface_alt_tree.xml(1): Valid XML should start with ''
@حساناليافعي-ق9ذ
@حساناليافعي-ق9ذ Жыл бұрын
​@@jabuszkodev🎉
@giuliocacucci2856
@giuliocacucci2856 4 жыл бұрын
Hi, great tutorial. Thanks a lot! Just a little tip for followers: "Use Emgu.CV V4.1.1.3497 (as in the video) to avoid errors with related functions".
@foxlearn
@foxlearn 4 жыл бұрын
Thanks for sharing
@peterstein4682
@peterstein4682 4 жыл бұрын
Very true
@keyboardwarrior2418
@keyboardwarrior2418 3 жыл бұрын
@@foxlearn His comment is very important. The newer version will indeed cause errors. It would be a good idea to pin his comment so that new people watching this video will get a heads-up.
@RmzPame
@RmzPame Жыл бұрын
@@keyboardwarrior2418 doesnt work for me
@classiciranian
@classiciranian 3 жыл бұрын
thank you very much . i'm a iranian programmer and very happy for create a channel for programmers c# . be succesful
@talhatariq5530
@talhatariq5530 4 жыл бұрын
I Really can't express the sense of satisfaction over this Video . Good work and really Helpful .
@foxlearn
@foxlearn 4 жыл бұрын
Thank you !
@ameerabdaljabar
@ameerabdaljabar 5 жыл бұрын
We need a project that compares the face, for example: - You have a group of photos of certain people, the number of thousands, and you take a picture of a modern person, the program compares the new image with the old photos and extracts the old image of his I think it's termed "image processing"
@foxlearn
@foxlearn 5 жыл бұрын
OK. Thank you for your suggestion. I'll upload soon !
@ameerabdaljabar
@ameerabdaljabar 4 жыл бұрын
Fox Learn any upload 😅
@aidanmcgeady7663
@aidanmcgeady7663 4 жыл бұрын
@FoxLearn is there a way to have 2 different types of boxes come up? Say a red box would appear if the image is in a file directory and a blue box if it is not? If so how would this be done? If that can't be done, then could you show a way to have a box appear but only on people who the programme has been "trained" to see?
@denisbmonteiro
@denisbmonteiro 5 жыл бұрын
Good job with the tutorials, there is really cool videos on your channel. Would be possible to upload more WPF videos please?
@foxlearn
@foxlearn 5 жыл бұрын
OK. Thank you for your suggestion !
@kamild3
@kamild3 4 жыл бұрын
Thank you for video. If I want to change video source as my desktop screen, what changes should I do in the code?
@foxlearn
@foxlearn 4 жыл бұрын
Change your picturebox dock to fill
@kamild3
@kamild3 4 жыл бұрын
@@foxlearn I want to capture faces from desktop screen not webcam. Is it gonna work?
@tamhoangminh197
@tamhoangminh197 2 жыл бұрын
Thankyou so much but I had an problem: I downloaded haarcascade_frontalface_alt_tree.xml file in the link github you've share but It still cannot detected my face, I added checkpoint that cascadeClassifier.DetectMultiScale(grayImage, 1.2, 1) always return empty array. Help me please
@mohammadthaher8454
@mohammadthaher8454 4 жыл бұрын
great video is there any video or project for medical face detection using emgu.cv c#?
@davidcerezoromero375
@davidcerezoromero375 4 жыл бұрын
So wonderful. Hi, do you know how I can stream the processed content ( the frames with rectangules over the smiles) to a client from a Web Server using emgucv ???
@foxlearn
@foxlearn 4 жыл бұрын
OK. Thank you for your suggestion. Let me try to research
@ranniesumacot4576
@ranniesumacot4576 3 жыл бұрын
Using this face recognition, how do you display the user's information using his face?
@seo.innovativedevelopment9157
@seo.innovativedevelopment9157 4 жыл бұрын
Error CS1503 Argument 1: cannot convert from 'System.Drawing.Bitmap' to 'byte[*,*,*]'
@hrutikpansare2895
@hrutikpansare2895 3 жыл бұрын
Same
@ivanestrada2688
@ivanestrada2688 3 жыл бұрын
@@hrutikpansare2895 Instala la version Emgu.CV 4.1.1.3497 en lugar de la mas nueva
@abdalrhmanatma3026
@abdalrhmanatma3026 3 жыл бұрын
how i can solve this "cannot convert from 'System.Drawing.Bitmap' to 'byte[*,*,*]'"
@ivanestrada2688
@ivanestrada2688 3 жыл бұрын
Instala la version Emgu.CV 4.1.1.3497 en lugar de la mas nueva
@u1krsh
@u1krsh 2 жыл бұрын
@@ivanestrada2688 Muchas gracias!
@thetechchap6260
@thetechchap6260 3 жыл бұрын
everything went perfect but not detecting the face why ?? can you please help me out
@MeloneXT-mh6vg
@MeloneXT-mh6vg 3 жыл бұрын
CS1503 Argument "1": Converting from "System.Drawing.Bitmap" in "byte[*,*,*]" not Possible Pls Help
@RmzPame
@RmzPame Жыл бұрын
I replace "Image grayImage = new Image(bitmap)" to "var grayImage = bitmap.ToImage();" it works for me
@spymancrackers
@spymancrackers 5 жыл бұрын
Very good tutorial Thank you very much
@foxlearn
@foxlearn 5 жыл бұрын
You're welcome. Thank you !
@bangsamorodeveloper1506
@bangsamorodeveloper1506 5 жыл бұрын
Wow! This is a wonderful tutorial... Thank you FoxLearn! By the way, is it possible to compare the face from the image saved in the database using that method? If a face was similar on one of the image saved in database, then it will say something! I hope you can make a tutorial for that.😁😊
@foxlearn
@foxlearn 5 жыл бұрын
Let me try to research. Thank you for your suggestion !
@TheSuper7777777
@TheSuper7777777 5 жыл бұрын
Yes please. I need tutorial like this
@puppz03
@puppz03 2 жыл бұрын
@@foxlearn Hi, have you done the code for this? Thanks in advance
@dhtlucky1984
@dhtlucky1984 5 жыл бұрын
Perfect! I wish i could like this video 1000 times. Do you try with a Decklink card & Professional SDI Camera?
@foxlearn
@foxlearn 5 жыл бұрын
At this time no. Thank you !
@keyboardwarrior2418
@keyboardwarrior2418 3 жыл бұрын
@@foxlearn What is the song name of the music that starts playing at 8:16? You forgot to mention it in your video description.
@khalilsaqib8176
@khalilsaqib8176 3 жыл бұрын
Please upload video on Face emotion detection
@hieudaica1304
@hieudaica1304 3 ай бұрын
I managed to make it work somehow but it is not really detect my face as I have expected.
@sairk6174
@sairk6174 4 жыл бұрын
Seems am bit late in subscribing to your channel ..vids are Awesome ..Thanks A Ton for sharing your knowledge. Actual i would like to know more on communication btw winforms and web browser control (customized with html controls as webpage ) .Any help ..much Appreciated .
@swerytv4342
@swerytv4342 5 жыл бұрын
Thanks for this tutorial yet. so i am waiting the system login and authorization that you have implement on JRE rental software with Devexpress.
@foxlearn
@foxlearn 5 жыл бұрын
I'll write the article on my site. Too much code i can't make the video tutorial
@swerytv4342
@swerytv4342 5 жыл бұрын
@@foxlearn I managed to implement login but i could not manage in the authorization and management of the colone role in other to print it in the gridview of Devexpress i am trying but nothing as solutions. Thank you.
@swerytv4342
@swerytv4342 5 жыл бұрын
@@foxlearn i don't need the video for that just a source code and comment for each line it's all please i am work on a project i would like To implement it.
@Дмитрийсекрет-н7о
@Дмитрийсекрет-н7о 5 жыл бұрын
Великолепный урок ))
@foxlearn
@foxlearn 5 жыл бұрын
Thank you !
@septiantriiriawan6531
@septiantriiriawan6531 5 жыл бұрын
Nice tutorial.. Could you please include your pc specs? Thanks
@Misicek
@Misicek 3 жыл бұрын
why u need that :D
@daalwada
@daalwada 4 жыл бұрын
My VideoCaptureDevice in Page Load event is throwing "Object Reference not set" error. How to add the input device in dropdown? (BDW I am creating this application in Laptop)
@foxlearn
@foxlearn 4 жыл бұрын
Please check your code again. I think you miss something
@malex1836
@malex1836 2 жыл бұрын
@Alex Caraballo did you solve it??
@RichardDika-kv7yj
@RichardDika-kv7yj 4 жыл бұрын
Very good tutorial
@foxlearn
@foxlearn 4 жыл бұрын
Thank you !
@shahakkuba8590
@shahakkuba8590 4 жыл бұрын
I've copied the code exactly to see if my errors were spacings or anything little I could miss but I still get the Error: CS1503 Argument 1: cannot convert from 'System.Drawing.Bitmap' to 'byte[*,*,*]'
@foxlearn
@foxlearn 4 жыл бұрын
Please check again. You can see demo code at foxlearn.com
@lavyksoares9962
@lavyksoares9962 4 жыл бұрын
I analyzed the case and saw that the error happens because of the version of Emgu.cv downloaded on NuGet. You need to downgrade to the version Emgu.cv V4.1.1.3497 on NuGet itself, to solve it for me.
@RmzPame
@RmzPame Жыл бұрын
I replace "Image grayImage = new Image(bitmap)" to var "grayImage = bitmap.ToImage();" it works for me
@desync7
@desync7 4 жыл бұрын
Webcam person detection?
@ncankalkan583
@ncankalkan583 3 жыл бұрын
why dont you give link "haars_frontface_alt_xtree.xml" files for download? :/
@abdalrhmanatma3026
@abdalrhmanatma3026 3 жыл бұрын
can i ask you a question
@Ruhgtfo
@Ruhgtfo 5 жыл бұрын
Thanks is works, but is not sensitive as expected and have mirror effect~ 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 AForge.Video; using AForge.Video.DirectShow; using Emgu.CV; using Emgu.CV.Structure; namespace FaceDetectionCamera { public partial class Form1 : Form { public Form1() { InitializeComponent(); } FilterInfoCollection filter; VideoCaptureDevice device; private void Form1_Load(object sender, EventArgs e) { filter = new FilterInfoCollection(FilterCategory.VideoInputDevice); foreach (FilterInfo device in filter) cboDevice.Items.Add(device.Name); cboDevice.SelectedIndex = 0; device = new VideoCaptureDevice(); } private void btnDetect_Click(object sender, EventArgs e) { device = new VideoCaptureDevice(filter[cboDevice.SelectedIndex].MonikerString); device.NewFrame += Device_NewFrame; device.Start(); } static readonly CascadeClassifier cascadeClassifier = new CascadeClassifier("haarcascade_frontalface_alt_tree.xml"); private void Device_NewFrame(object sender, NewFrameEventArgs eventArgs) { Bitmap bitmap = (Bitmap)eventArgs.Frame.Clone(); Image grayImage = new Image(bitmap); Rectangle[] rectangles = cascadeClassifier.DetectMultiScale(grayImage, 1.2, 1); foreach (Rectangle rectangle in rectangles) { using (Graphics graphics = Graphics.FromImage(bitmap)) { using (Pen pen = new Pen(Color.Red, 1)) { graphics.DrawRectangle(pen, rectangle); } } } pic.Image = bitmap; } private void Form1_FormClosing(object sender, FormClosingEventArgs e) { if (device.IsRunning) device.Stop(); } } }
@foxlearn
@foxlearn 4 жыл бұрын
Thank you !
@wONd3ry
@wONd3ry 11 ай бұрын
100% working
@adorablelaughter4093
@adorablelaughter4093 5 жыл бұрын
Thanks for the tutorial. But pls I have a problem, the camera captures images well but it's not detecting the face. I had issues downloading the engine.cv, the one with over 200k download, so I downloaded the one with over 100k download. Could that be the cause?
@foxlearn
@foxlearn 5 жыл бұрын
What error are you getting?
@adorablelaughter4093
@adorablelaughter4093 5 жыл бұрын
@@foxlearn it does not throw any exceptions. It builds well, but while capturing the image, it does not detect the face neither does it show any rectangular line.
@lawrencekraft106
@lawrencekraft106 4 жыл бұрын
Have you solved the problem already? It seems I´m having the same issue
@marymory28
@marymory28 4 жыл бұрын
I had the same problem, but I change the library of Emug.CV to EmugCV and if you have another thing, for example --> Image grayImage = new Image(bitmap.Size); it should stay with Image grayImage = new Image(bitmap);
@jeraldsamonte1264
@jeraldsamonte1264 4 жыл бұрын
System.TypeInitializationException: 'The type initializer for 'Face_Detection_Camera.Form1' threw an exception.' im getting this error hope you can help
@foxlearn
@foxlearn 4 жыл бұрын
Please check your code again. i think you missing something
@yourspdahal5606
@yourspdahal5606 4 жыл бұрын
can i use it my own system
@foxlearn
@foxlearn 4 жыл бұрын
Yes, you can
@yourspdahal5606
@yourspdahal5606 4 жыл бұрын
​@@foxlearn may i use haarcascade_frontalface_alt2.xml file for development of software and distribution it. how can i use this Copyright (C) 2000, Intel Corporation, please help me . Thank you!!!
@leinah3671
@leinah3671 4 жыл бұрын
is object detection included?
@foxlearn
@foxlearn 4 жыл бұрын
face detection
@sinhnguyennguyen4329
@sinhnguyennguyen4329 5 жыл бұрын
Follow code instruction, it can show webcam but it could not show rectangle on the face. Debug code in frame event, it always returns zero rectangle, so it could not draw red rectangle on the face. What happen to me?
@foxlearn
@foxlearn 5 жыл бұрын
Select an other picture or you can detect your face via webcam
@prometeusz.jasinski
@prometeusz.jasinski 4 жыл бұрын
@@foxlearn Does not work with my german face either. Facing the cam on the youtube video detects the face there. I guess now I need to dig into openCV...
@danielezekielulep4956
@danielezekielulep4956 4 жыл бұрын
I have a problem "pic.image does not exist in the current context" What does pic.image mean?
@foxlearn
@foxlearn 4 жыл бұрын
pic is a name of your PictureBox control
@vungocquang6838
@vungocquang6838 5 жыл бұрын
Hi. How to change the server name is PC / SQLEXPRESS to PC. Thanhk you
@ohfam6631
@ohfam6631 4 жыл бұрын
i got this error: cannot convert from 'System.Drawing.Bitmap' to 'byte[*,*,*]' how could i fix this?
@foxlearn
@foxlearn 4 жыл бұрын
Please check your code again. I think you miss something
@shahakkuba8590
@shahakkuba8590 4 жыл бұрын
i got the same error did u find out what the issue was?
@lavyksoares9962
@lavyksoares9962 4 жыл бұрын
I analyzed the case and saw that the error happens because of the version of Emgu.cv downloaded on NuGet. You need to downgrade to the version Emgu.cv V4.1.1.3497 on NuGet itself, to solve it for me.
@daalwada
@daalwada 4 жыл бұрын
@@lavyksoares9962 Thanks Buddy! :) It helped me solve my issue.
@rapidengineering2055
@rapidengineering2055 4 жыл бұрын
@@lavyksoares9962 Thanks
@hambalilubis361
@hambalilubis361 5 жыл бұрын
Real time detection please
@foxlearn
@foxlearn 5 жыл бұрын
Thank you for your suggestion !
@Khaner8
@Khaner8 4 жыл бұрын
Image grayImage = new Image(bitmap); I have an error on the last "bitmap". It says Error CS1503 Argument 1: cannot convert from 'System.Drawing.Bitmap' to 'byte[*,*,*]' I need Help
@juanottaviano4017
@juanottaviano4017 4 жыл бұрын
Latest Emgu.cv version removed the Image(Bitmap bitmap) definition. Best solution is to download the exact same version as in the video.(v4.1.1.3497) which still has the Bitmap parameter definition.
@Khaner8
@Khaner8 4 жыл бұрын
@@juanottaviano4017 okie dokie
@QutadaAlFannad
@QutadaAlFannad 4 жыл бұрын
Our Friend solved it Lavyk Soares Lavyk Soares 1 month ago (edited) I analyzed the case and saw that the error happens because of the version of Emgu.cv downloaded on NuGet. You need to downgrade to the version Emgu.cv V4.1.1.3497 on NuGet itself, to solve it for me.
@raresh1272
@raresh1272 3 жыл бұрын
why it doesn't detect my camera? please help
@ShakirAlimit
@ShakirAlimit 4 жыл бұрын
EMGU.CV is open source ?
@foxlearn
@foxlearn 4 жыл бұрын
Yes, It's an opensource
@relaxingsatisfying9441
@relaxingsatisfying9441 5 жыл бұрын
Amazing.. ..
@foxlearn
@foxlearn 5 жыл бұрын
Thank you !
@ProjectCluster_0
@ProjectCluster_0 11 ай бұрын
The downgrade emguCv solution is not working, when I installed it it just made the cascadeclassifier not working saying there's no cascadeclassifier
@jameelurrehman8587
@jameelurrehman8587 5 жыл бұрын
خوب
@foxlearn
@foxlearn 5 жыл бұрын
Thank you !
@abmtechnologies
@abmtechnologies 5 жыл бұрын
sorry Sir but I don't Understand what is "cdoDevice"
@foxlearn
@foxlearn 5 жыл бұрын
cboDevice is a name of your Combobox
@abmtechnologies
@abmtechnologies 5 жыл бұрын
thanks
@braydencunningham9337
@braydencunningham9337 5 жыл бұрын
So, i'm having a problem on line 29 where it says " Error CS1061 'VideoCaptureDevice' does not contain a definition for 'name' and no accessible extension method 'name' accepting a first argument of type 'VideoCaptureDevice' could be found (are you missing a using directive or an assembly reference?)" but I don't know how to fix it
@foxlearn
@foxlearn 5 жыл бұрын
You should install the libraries, and don't forget to include to your namespace
@SigmaGamerProzst
@SigmaGamerProzst 4 жыл бұрын
trainer link: github.com/opencv/opencv/blob/master/data/haarcascades/haarcascade_frontalface_alt_tree.xml
@lehong8046
@lehong8046 5 жыл бұрын
Great !
@foxlearn
@foxlearn 5 жыл бұрын
Thank you :)
@moussagerges6709
@moussagerges6709 4 жыл бұрын
Thank you very much😊, you can find source code here: github.com/MoussaGerges9/Face-Detection.git
@foxlearn
@foxlearn 4 жыл бұрын
Thank you !
@r50142
@r50142 5 жыл бұрын
Oh WOW!
@foxlearn
@foxlearn 5 жыл бұрын
Thank you !
@atsmv2964
@atsmv2964 3 жыл бұрын
private void Device_NewFrame(object sender, NewFrameEventArgs eventArgs) { Bitmap bitmap = (Bitmap)eventArgs.Frame.Clone(); //Image grayImage = new Image(bitmap); //GraphicsImage = Image.FromFile(openfiledialog1.FileName) as Bitmap; Image grayImage = new Image(bitmap); i have problem at code here: Image grayImage = new Image(bitmap); the error is at (bitmap) the error is : Error CS1503 Argument 1: cannot convert from 'System.Drawing.Bitmap' to 'byte[*,*,*]'
@akhilan8293
@akhilan8293 2 жыл бұрын
I'm also have this error
@FereshtehJourney
@FereshtehJourney 2 жыл бұрын
I have the same error! I can't install the downgrade version because I am coding in .NET core 3.1, please help me to solve it
@The_Sifter
@The_Sifter 4 жыл бұрын
github link is 404 error
@prometeusz.jasinski
@prometeusz.jasinski 4 жыл бұрын
github.com/opencv/opencv/blob/master/data/haarcascades/haarcascade_frontalface_alt_tree.xml in my case I forgot to type twice "opencv"
@Dione5G
@Dione5G 2 жыл бұрын
I love you
@aamirgour3604
@aamirgour3604 3 жыл бұрын
Not working properly
@SigmaGamerProzst
@SigmaGamerProzst 4 жыл бұрын
4:05 please ignore this comment
@ogunkilic2625
@ogunkilic2625 5 жыл бұрын
github.com/opencv/opencv/tree/master/data/haarcascades Github link
@foxlearn
@foxlearn 5 жыл бұрын
Thank you !
@alirezaabedi1885
@alirezaabedi1885 5 жыл бұрын
like.
@foxlearn
@foxlearn 5 жыл бұрын
Thank you !
@vib_yt9806
@vib_yt9806 2 жыл бұрын
It says cbodevice not found
@redev4781
@redev4781 5 жыл бұрын
pleas taining c# face compare
@foxlearn
@foxlearn 5 жыл бұрын
OK. Thank you for your suggestion !
@mohammedmuzzammil1184
@mohammedmuzzammil1184 Жыл бұрын
private void Device_NewFrame(object sender, NewFrameEventArgs eventArgs) { Bitmap bitmap = (Bitmap)eventArgs.Frame.Clone(); Image grayscale = new Image(bitmap); Rectangle[] rectangles = cascadeClassifier.DetectMultiScale(grayscale, 1.2, 1); foreach (Rectangle rectangle in rectangles) { using(Graphics graphics=Graphics.FromImage(bitmap)) { using(Pen pen=new Pen(Color.Red,1)) { graphics.DrawRectangle(pen, rectangle); } } } pictureBox1.Image = bitmap; } this event is not triggering
@莫逆逼
@莫逆逼 5 жыл бұрын
redline disapear >
@foxlearn
@foxlearn 5 жыл бұрын
Thank you !
@ivanarabome4172
@ivanarabome4172 3 жыл бұрын
Wrong.... not accurate in detection and very slow
@seo.innovativedevelopment9157
@seo.innovativedevelopment9157 4 жыл бұрын
Error CS1503 Argument 1: cannot convert from 'System.Drawing.Bitmap' to 'byte[*,*,*]'
@gogakakabadze
@gogakakabadze 3 жыл бұрын
**** Solution **** Install EmguCV instead of EMGU.CV !!! **** Solution**** That worked for me!
@gogakakabadze
@gogakakabadze 3 жыл бұрын
Do not forget to delete Emgu.CV before or after you install EmguCV!!!!!
C# Tutorial - QR Code Scanner using Webcam in C# | FoxLearn
8:16
C# Video Capture Smartphone over WiFi using EmguCV
17:48
EETechStuff
Рет қаралды 4,5 М.
Simple Machine Learning GUI App with Taipy and Tensorflow
30:52
Python Simplified
Рет қаралды 176 М.
Code with me using Python and AI to build a face detection app
10:55
How Senior Programmers ACTUALLY Write Code
13:37
Thriving Technologist
Рет қаралды 1,6 МЛН
C# Image & Video Processing using EmguCV
21:01
EETechStuff
Рет қаралды 13 М.
Generative AI into ANY .NET App with SemanticKernel
12:39
Nick Chapsas
Рет қаралды 50 М.
Google’s Quantum Chip: Did We Just Tap Into Parallel Universes?
9:34
Emgucv # 28: Face detection using Cascade Classifiers: Haar and LBP
27:33