English 中文(简体)
开放式集装箱舱面孔径
原标题:OpenCV facedetect example won t load cascade classifier xml

I m working on a application that requires OpenCV object detection using Haar cascade classifier. I m using OpenCV 2.3.1 with VS2010 on a 64bit Windows Machine. I compiled and built OpenCV myself and didn t use any pre-compiled binaries.

First, I wanted to start meddling with the example facedetect.cpp that s included in OpenCV. I built it with no errors, but when I m trying to run it won t open the cascade classifier xml file (the CascadeClassifier.load() function returns false). I didn t change anything from the sample source code.

I m using the xml file that is distributed with OpenCV so the problem isn t with the xml file. I also made sure that the application can access and read the file using a simple fopen.

I believe (but not sure) that the problem seems to be that the cascade classifier is of an "old" type. But in the OpenCV documentation it is specifically implied that the new CascadeClassifier object can open both "old" and "new" cascade classifiers.

这里的链接:http://opencv.itseez.com/modules/objdetect/doc/cas_cadeification.html#cascadenalifier-load

我甚至利用了预先准备的开放CV2.2双手,并且与这xml公司进行了出色的工作。 然后,我试图汇编2.2种来源代码样本,并再次把罐装上Xml。

我知道,我可以尝试使用旧物体CvHaarClassifierCascade,但我更喜欢使用最新的开放CV及其物体。

是否有任何人把我究竟做什么错呢?

问题回答

2. 整条xml文档

String face = "c:/data/xml/haarcascade_frontalface_alt.xml";

它应当努力!

我通过使用附注D++来完成这项工作。 我将所有相关的xml文档转换为ANSI,并删除了第1行的<代码><?xml edition=“1.0”?>,然后用手方式重改。

如果你使用窗户,就会检查道路。 关切

  1. escape sequence in the path.
  2. forward or backward slash depending on operating system.

It should be like C:\Ceemple\data\haarcascades\haarcascade_frontalface_alt.xml. (by the way I am using Ceemple IDE)





相关问题
Undefined reference

I m getting this linker error. I know a way around it, but it s bugging me because another part of the project s linking fine and it s designed almost identically. First, I have namespace LCD. Then I ...

C++ Equivalent of Tidy

Is there an equivalent to tidy for HTML code for C++? I have searched on the internet, but I find nothing but C++ wrappers for tidy, etc... I think the keyword tidy is what has me hung up. I am ...

Template Classes in C++ ... a required skill set?

I m new to C++ and am wondering how much time I should invest in learning how to implement template classes. Are they widely used in industry, or is this something I should move through quickly?

Print possible strings created from a Number

Given a 10 digit Telephone Number, we have to print all possible strings created from that. The mapping of the numbers is the one as exactly on a phone s keypad. i.e. for 1,0-> No Letter for 2->...

typedef ing STL wstring

Why is it when i do the following i get errors when relating to with wchar_t? namespace Foo { typedef std::wstring String; } Now i declare all my strings as Foo::String through out the program, ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

Window iconification status via Xlib

Is it possible to check with the means of pure X11/Xlib only whether the given window is iconified/minimized, and, if it is, how?

热门标签