Click here to Skip to main content
Rate this: bad
Please Sign up or sign in to vote.
See more: C#
It's emguCV project. How I can set ROI for mouth detection when I detect and extract face? This ROI must be on a bottom third of this detected image so the program will trying to find mouth just at the bottom third of the image not in whole image.
Here is some code to understand it better:
Image InputImg2 = Image.FromFile(@"image1.bmp");
Image<Bgr, byte> ImageFrame2 = new Image<Bgr, byte>(new Bitmap(InputImg2));
Image<Gray, Byte> grayframe = ImageFrame2.Convert<Gray, Byte>();
grayframe.ROI = face.rect //// ???? Can I improve this part of code to set ROI for just bottom third of this "face rectangle"???

Mouth = new HaarCascade("Mouth.xml");     //haar cascade for mouth

var mouths = Mouth.Detect(grayframe);
foreach (var mouthh in mouths)
                 ImageFrame2.Draw(mouthh.rect, new Bgr(Color.Blue), 2);
             imageBox2.Image = ImageFrame2;
Posted 26-Nov-12 5:14am

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 7,205
1 DamithSL 5,114
2 Maciej Los 4,866
3 Sergey Alexandrovich Kryukov 4,747
4 Kornfeld Eliyahu Peter 4,474

Advertise | Privacy | Mobile
Web01 | 2.8.141223.1 | Last Updated 26 Nov 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100