For OpenCV, FaceRecognizer class is not found on Ubuntu. [closed]

asked 2017-11-20 08:41:35 -0500

venkatesh-u gravatar image

I am using java for this but FaceRecognizer class is not detected.
I got some hint for this, in ubuntu when we use cmake command for building opencv-contrib it generates java folder but in ubuntu, there is no java folder in module directory. is that where something going wrong??
If it is the reason, somewhere someone has posted a solution for that
https://github.com/opencv/opencv_cont...

In this link, CMakeLists.txt is added with some lines and running the cmake command and compiling it is also not working.
Could you please post the solution.
Thank you.

edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by sturkmen
close date 2020-11-30 09:36:59.945287

Comments

1
  • please add the cmake output to your question
  • if there are any errors, we need to see them, too !
  • what are you trying to do with the face-recognition ?
berak gravatar imageberak ( 2017-11-20 09:12:16 -0500 )edit

Output: (con) --There are no errors and its configured completely too. -- working in windows but not ubuntu. I need it to be in ubuntu. -- Doing an application which recognizes the faces for that i need face-recognition class.

venkatesh-u gravatar imagevenkatesh-u ( 2017-11-20 23:38:32 -0500 )edit

we cannot help you, if all you can say is: "does not work"

berak gravatar imageberak ( 2017-11-21 01:49:34 -0500 )edit

I have followed the below link for installation of opencv and opencv-contrib and used java language as building the application. can you find out anything is wrong in these commands.

https://www.learnopencv.com/install-o...

venkatesh-u gravatar imagevenkatesh-u ( 2017-11-21 07:47:30 -0500 )edit

showing tutorials you tried to follow is entirely useless. we need to know, what YOU did, not someone else.

berak gravatar imageberak ( 2017-11-21 08:17:20 -0500 )edit

sudo apt-get update sudo apt-get upgrade

sudo apt-get remove x264 libx264-dev

sudo apt-get install build-essential checkinstall cmake pkg-config yasm gfortran git sudo apt-get install libjpeg8-dev libjasper-dev libpng12-dev

If you are using Ubuntu 14.04

sudo apt-get install libtiff4-dev sudo apt-get install libavcodec-dev libavformat-dev libswscale-dev libdc1394-22-dev sudo apt-get install libxine2-dev libv4l-dev sudo apt-get install libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev sudo apt-get install libqt4-dev libgtk2.0-dev libtbb-dev sudo apt-get install libatlas-base-dev sudo apt-get install libfaac-dev libmp3lame-dev libtheora-dev sudo apt-get install libvorbis-dev libxvidcore-dev sudo apt-get install libopen

venkatesh-u gravatar imagevenkatesh-u ( 2017-11-21 08:26:59 -0500 )edit

sudo apt-get install libprotobuf-dev protobuf-compiler sudo apt-get install libgoogle-glog-dev libgflags-dev sudo apt-get install libgphoto2-dev libeigen3-dev libhdf5-dev doxygen

Download opencv & opencv_contrib from Github

git clone https://github.com/opencv/opencv.git cd opencv git checkout 3.3.0 cd ..

git clone https://github.com/opencv/opencv_cont... cd opencv_contrib git checkout 3.3.0 cd ..

cd opencv mkdir build cd build

cmake -D CMAKE_BUILD_TYPE=RELEASE \ -D CMAKE_INSTALL_PREFIX=/usr/local \ -D INSTALL_C_EXAMPLES=ON \ -D INSTALL_PYTHON_EXAMPLES=ON \ -D WITH_TBB=ON \ -D WITH_V4L=ON \ -D WITH_QT=ON \ -D WITH_OPENGL=ON \ -D OPENCV_EXTRA_MODULES_PATH=/home/venkatesh/OPENCV2/opencv_contrib/modules \ -D BUILD_EXAMPLES=ON

venkatesh-u gravatar imagevenkatesh-u ( 2017-11-21 08:30:36 -0500 )edit

Compile and Install

nproc
make -j4
sudo make install
sudo sh -c 'echo "/usr/local/lib" >> /etc/ld.so.conf.d/opencv.conf'
sudo ldconfig

venkatesh-u gravatar imagevenkatesh-u ( 2017-11-21 08:34:27 -0500 )edit

cmake output

OpenCV modules: -- To be built:
core flann hdf imgproc ml objdetect phase_unwrapping photo plot reg surface_matching video viz xphoto bgsegm dnn face freetype fuzzy img_hash imgcodecs shape videoio xobjdetect highgui superres ts bioinspired dpm features2d line_descriptor saliency text calib3d ccalib datasets rgbd stereo structured_light tracking videostab xfeatures2d ximgproc aruco java optflow sfm stitching python2
-- Disabled: world contrib_world
-- Disabled by dependency: -
-- Unavailable: cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev python3 cnn_3dobj cvv dnn_modern matlab

venkatesh-u gravatar imagevenkatesh-u ( 2017-11-21 08:40:41 -0500 )edit

GUI:
-- QT 4.x: YES (ver 4.8.6 EDITION = OpenSource)
-- QT OpenGL support: YES (/usr/lib/x86_64-linux-gnu/libQtOpenGL.so)
-- OpenGL support: YES (/usr/lib/x86_64-linux-gnu/libGLU.so /usr/lib/x86_64-linux-gnu/libGL.so
/usr/lib/x86_64-linux-gnu/libSM.so /usr/lib/x86_64-linux-gnu/libICE.so /usr/lib/x86_64-linux-gnu/libX11.so /usr/lib/x86_64-linux-gnu/libXext.so)

-- VTK support: YES (ver 5.8.0)

-- Media I/O:
-- ZLib: /usr/lib/x86_64-linux-gnu/libz.so (ver 1.2.8)
-- JPEG: /usr/lib/x86_64-linux-gnu/libjpeg.so (ver )
-- WEBP: build (ver encoder: 0x020e)

venkatesh-u gravatar imagevenkatesh-u ( 2017-11-21 08:42:41 -0500 )edit