FaceRecognizer在OpenCV中 [英] FaceRecognizer in OpenCV

查看:1088
本文介绍了FaceRecognizer在OpenCV中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在读文章

http://docs.opencv.org/trunk/modules/contrib/doc/facerec/facerec_tutorial.html#conclusion

和尝试运行code facerec_lbph.cpp 。然而,我遇到了以下错误:

and try to run the code facerec_lbph.cpp . However, I ran into the following errors:

facerec_lbph.cpp:109:9: error: ‘FaceRecognizer’ was not declared in this scope
facerec_lbph.cpp:109:23: error: template argument 1 is invalid
facerec_lbph.cpp:109:31: error: invalid type in declaration before ‘=’ token
facerec_lbph.cpp:109:58: error: ‘createLBPHFaceRecognizer’ was not declared in this scope
facerec_lbph.cpp:110:10: error: base operand of ‘->’ is not a pointer
facerec_lbph.cpp:113:31: error: base operand of ‘->’ is not a pointer
facerec_lbph.cpp:132:10: error: base operand of ‘->’ is not a pointer
facerec_lbph.cpp:136:27: error: base operand of ‘->’ is not a pointer
facerec_lbph.cpp:144:18: error: base operand of ‘->’ is not a pointer
facerec_lbph.cpp:145:18: error: base operand of ‘->’ is not a pointer
facerec_lbph.cpp:146:18: error: base operand of ‘->’ is not a pointer
facerec_lbph.cpp:147:18: error: base operand of ‘->’ is not a pointer
facerec_lbph.cpp:148:18: error: base operand of ‘->’ is not a pointer
facerec_lbph.cpp:151:35: error: base operand of ‘->’ is not a pointer

在OpenCV版本为

The OpenCV version is

opencv-2.3.1-3.fc16.x86_64
opencv-python-2.3.1-3.fc16.x86_64
opencv-devel-2.3.1-3.fc16.x86_64
opencv-devel-docs-2.3.1-3.fc16.noarch

和系统版本的Fedora 16为64位。我使用的Makefile是:

And the system version is fedora 16 which is 64 bits. The makefile I'm using is:

CC = g++

SRC = facerec_lbph.cpp
TARGET = main

OBJS = facerec_lbph.o


INCDIRS = -I/usr/include/opencv -I/usr/include/opencv2
LIBDIRS = -L/usr/lib64

CFLAGS = -g $(INCDIRS)
LFLAGS = -lopencv_core -lopencv_highgui -lopencv_video -lopencv_imgproc -lopencv_objdetect -lopencv_ml -lopencv_contrib


all: $(OBJS)
    $(CC) -o $(TARGET) $(OBJS) $(INCDIRS) $(LIBDIRS) $(LFLAGS)
main.o: $(SRC) $(INCLUDE)
    $(CC) -c $(SRC) $(INCLUDE) $(INCDIRS) $(LIBDIRS) $(LFLAGS)

clean:
    rm -f $(TARGET) $(OBJS) *.gch

和我能更新错误报告,每当新的信息是必要的。谢谢!

And I can update the error report whenever new information is necessary. Thanks!

推荐答案

现在的问题是,你正在使用OpenCV的2.3.1。这OpenCV的版本没有一个品种:: FaceRecognizer然而,这样解释你的错误信息。我强烈建议您更新到2.4.2 OpenCV的。

The problem is, that you are using OpenCV 2.3.1. This OpenCV Version didn't have a cv::FaceRecognizer yet, so that explains your error message. I would strongly suggest you update to OpenCV 2.4.2.

文档附带了很多样的:

  • http://docs.opencv.org/trunk/modules/contrib/doc/facerec/index.html
  • http://code.opencv.org/projects/opencv/repository/show/trunk/opencv/modules/contrib/doc/facerec/src

不过,如果您无法更新到最新的OpenCV版本,你也可以尝试使用 libfacerec 0.03版本(libfacerec是我促成了OpenCV的项目)。它兼容所有的OpenCV 2.3版本。它有一个稍微不同的界面,但同样的算法。下面是可用的标签,你可以下载:

However if you can't update to recent OpenCV versions, you could also try to use version 0.03 of libfacerec (libfacerec is the project I contributed to OpenCV). It is compatible to all OpenCV 2.3 versions. It has a slightly different interface, but the same algorithms. Here are the available tags, you could download:

这篇关于FaceRecognizer在OpenCV中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆