Click here to Skip to main content
12,890,388 members (57,790 online)
Rate this:
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 4:14am

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

    Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170424.1 | Last Updated 26 Nov 2012
Copyright © CodeProject, 1999-2017
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