user2573299
user2573299

Reputation: 1

Face Detection in EmguCV ( a bug in X64 )

i am running face detection in emgucv. I used this code but it is not working... i mean that it doesnot detect ant face and returns ZERO faces. its getting me crazy because i tried every thing.

my system is X64 and Win7. "i thought there must be a bug in emgu code".

please for the sake of god some on help me!

namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            HaarCascade haar = new HaarCascade("haarcascade_frontalface_alt_tree.xml");

            Image<Bgr, Byte> image = new Image<Bgr, byte>("lena.jpg");

            Image<Gray, Byte> gray = image.Convert<Gray, Byte>();     

            var faces = gray.DetectHaarCascade(haar,1.4, 4,HAAR_DETECTION_TYPE.DO_CANNY_PRUNING,new Size(30,30))[0];

            foreach (var face in faces)

                image.Draw(face, new Bgr(255, 0, 0), 3);

            MessageBox.Show(faces.Length.ToString());

            pictureBox1.Image = image.ToBitmap();

        }
    }
}

help,help,...

Upvotes: 0

Views: 1930

Answers (2)

user2573299
user2573299

Reputation: 1

I do not why but it happens on 3 different computers. and they are X64 and win7.

the only way is to copy ALL dll files in emgucv\...\bin\x86 to yourproject\...\debug.

I repeat copy all dll from x86 folder (not x64 folder) to your destination folder.

If you copied them to your system32, it does not work either.

i hope it helps you.

Upvotes: 0

Luca Del Tongo
Luca Del Tongo

Reputation: 2702

There could be some potential issues in your code, it could be the xml haarcascade you're using or wrong params values in DetectHaarCascade function.

I leave you a link of an official example that works:

Emgu Face Detection Example

Hope this helps...

Upvotes: 1

Related Questions