1
$ uname -a
Linux laptop 4.19.0-2-amd64 #1 SMP Debian 4.19.16-1 (2019-01-17) x86_64 GNU/Linux

I need to use cv::face::createLBPHFaceRecognizer(), which is not a part of the core OpenCV but rather a contributed module.

$ dpkg -l libopencv-contrib-dev
ii  libopencv-contrib-dev:amd64 3.2.0+dfsg-6 amd64        development files for libopencv-contrib3.2

everything fine ... no:

 src/cmd.cpp:150: error: ‘cv::face’ has not been declared
 const auto model = cv::face::createLBPHFaceRecognizer();
                        ^~~~

OK. Let's then include the needed headers manually:

$ dpkg -S libopencv-contrib-dev
libopencv-contrib-dev:amd64: /usr/share/doc/libopencv-contrib-dev
libopencv-contrib-dev:amd64: /usr/share/doc/libopencv-contrib-dev/changelog.Debian.gz
libopencv-contrib-dev:amd64: /usr/share/doc/libopencv-contrib-dev/copyright
libopencv-contrib-dev:amd64: /usr/share/doc/libopencv-contrib-dev/README.Debian

Nothing! Is this a packager's mistake (this is Debian testing after all)? An OpenCV peculiarity? A minor oversight on my side? I would like to continue using the package manager, instead of compiling the whole thing myself.

5

The package is fine, you’re using the wrong dpkg option:

dpkg -L libopencv-contrib-dev

will list all the files in the libopencv-contrib-dev, which is what you’re after (and will show all the files listed here), whereas

dpkg -S libopencv-contrib-dev

searches all installed packages for files with libopencv-contrib-dev in their path, which only matches the four files you’ve listed.

1

It was an oversight.

#include <opencv2/opencv.hpp>
#include <opencv2/face.hpp>

The first include is insufficient, the second one is needed as well.

Although this solves the problem, I would appreciate an explaination why don't any useful files show up in dpkg -S.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.