Problem with building opencv_contrib. Cannot find file face.hpp.
I want to use FaceRecognizer class. As far as I know, it's not present in OpenCV 3.* versions, so I need to build opencv_contrib repository to be able to use it in my projects.
Unfortunately something went wrong, I've built it, but I still can't find face.hpp
file in libraries folder. Here is what I've done to build it:
This is where I installed OpenCV and how it looks like:
This is where I've copied opecv_contrib
and how it looks like on my drive:
This is how I configured cmake-gui it build new libraries:
When I try to include face.hpp in my code:
#include "opencv2/face.hpp"
I see: cannot open source file "opencv2/face.hpp"
and identifier "FaceRecognizer" is undefined
.
Am I doing something wrong?
it works with #include "opencv2/face.hpp" or with #include <opencv2 face.hpp="">
Have you check that BUILD_opencv_face is checked ? and BUILD_opencv_objdetect is checked too ?
@LBerger If you are talking about options in cmake-gui, then: yes, they are all checked, but BUILD_opencv_face is highlighted in red. Does it mean something?
Yes it is in CMake GUI. About red I don't know. Have you build opencv with samples? if yes check if facerec_demo.cpp samples is OK.
@LBerger no, it's not, because, like in my project, compiler can't find "opencv2/face.hpp"
To build opencv you have to clone it from github
Its simple, if something is red in cmake then it means something is wrong. You are lucky, for OpenCV 3 Blueprints we also used the face module, so we have a tutorial completely describing the configuration. Can you take a look there?
I'm not sure that if something is red something is wrong using CMake 3.7.1. When I leave cmake everything is white and when I reopen cmakelists everything is red
@StevenPuttemans: I've followed tutorial that you've linked. I deleted all opencv libs and I've built everything from scratch. Now, my Visual Studio doesn't seem to see any of opencv libraries. Not only face.hpp but all of them. As far as I know, all libraries should be present in include folder, they aren't https://monosnap.com/file/gzTOy8ec1Kj...
BTW do I need to build it by myself? Why didn't opencv team built it and share it just like they did with "base" opencv here: http://opencv.org/downloads.html? I'm not a power user, I just want to use OpenCV in one of my projects.
"This repository is intended for development of so-called "extra" modules, contributed functionality. New modules quite often do not have stable API, and they are not well-tested. Thus, they shouldn't be released as a part of official OpenCV distribution, since the library maintains binary compatibility, and tries to provide decent performance and stability."