参考: http://opencv.willowgarage.com/wiki/FaceDetection
把代码保存为facedetect.c,用VC打开,直接build,让VC创建.dsp。
选择菜单Project -> Setting -> Link,在下拉列表中选择Input,在Additional library path框中加入:$OPENCV_INSTALL_DIR\lib
选择菜单Project -> Setting -> Link,在下拉列表中选择General,加入三个库文件:cxcored.lib cvd.lib highguid.lib。注意:对于Release版本,建议加入cxcore.lib cv.lib highgui.lib。
编译 。
运行:
facedetect.exe --cascade="$OPENCV_INSTALL_DIR/data/haarcascades/haarcascade_frontalface_alt.xml"
当然,如果跟$OPENCV_INSTALL_DIR\bin不在同一个目录下,那么:
把$OPENCV_INSTALL_DIR\bin下面的cv100.dll cvaux100.dll cvcam100.dll cxcore100.dll cxts001.dll highgui100.dll libguide40.dll ml100.dll 拷贝到Release目录下;
把$OPENCV_INSTALL_DIR\bin下面的v100d.dll cvaux100d.dll cvcam100d.dll cxcore100d.dll cxts001d.dll highgui100d.dll libguide40.dll ml100d.dll拷贝到Debug目录下;
OK!
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment