Quantcast
Channel: OpenCV Q&A Forum - Latest question feed
Viewing all 53 articles
Browse latest View live

Combining FisherFaces and LBPH to improve accuracy

0
0
Hi everyone, i’m trying to implement a face recognition system for a video surveillance application. In this context test images are low quality, illumination change from an image to another, and, moreover, the detected subjects are not always in the same pose. As first recognizer i used FisherFaces and, with 49 test images, i obtain an accuracy of 35/49, without considering the distances of each classified subject (i just considered labels). Trying to get a better accuracy i attempt to make a preprocessing both of training images and test images; the preprocessing i choose is described in “Mastering OpenCV with Practical Computer Vision Projects” book. The steps are: 1. detection of the eyes in order to allign and rotate a face; 2. separate histogram equalization to standardize the lighting in the image; 3. filtering to reduce the effect of pixel noise because the histogram equalization increase it; 4. the last step is to apply an elliptical mask to the face in order to delete some details of the face that are not significant for the recognition. Well, with this type of preprocessing, i obtain worse results than before (4/49 subjects properly classified). So i thought of using another classifier, the LBPH recognizer, to improve the accuracy of the recognition since these two types of algorithms have different features and different ways to classify a face; if one use them together maybe the accuracy increase. So my question is about the ways to combine these two algorithms; anyone knows how to merge the two outputs in order to obtain better accuracy? I thought at this: if FisherFaces and LBPH give the same result (the same label) then there is no problem; otherwise if they disagree my idea is to take the vector of the labels and the vector of the distances for each algorithm and for each subject sum the corresponding distances; at this point the label of the test image is the one that has the shortest distance. This is just my idea but there are other ways to fuse the output of both algorithm also because i should change the code of the predict function of face module in OpenCV since it returns an int type not a vector of int.

How to reduce false positives for face detection

0
0
I'm using the `CascadeClassifier` object to detect faces in a video sequence, but I'm seeing a high rate of false positives. To combat this, I thought I would try to detect eye pairs within the ROI of the detected faces, but several of my videos seem to be too low resolution to do the eye detection. What is the recommended alternative for avoiding false positives?

AttributeError: 'module' object has no attribute 'face'

0
0
Hi, I compiled the opencv with contrib modules in the cmake GUI and everything seems ok, but when I try to use face module (cv2.face) I receive the following message:> AttributeError: 'module' object has no attribute 'face' Can someone help me please? I lost few days trying to solve that but nothing works. I'm using Windows 8.1 and Python 2.7 Thanks

EM:: OPENCV 2.4.11

0
0
Hi, i'm looking forward a simple tutorial that explains for noobs the Expectation Maximization, and how to implement it, to collect data from a picture for example, or real time camera. Thank you for your consideration ! I'm using Xcode and OpenCV 2.4.11

Add a public function to face recognition src-file

0
0
I have a c++ program from where I can create a LBPHFaceRecognizer, train it with with data, send an image for prediction etc. But now I want to customize lbph_faces.cpp. I can change/add private stuff in it, build and compile, and it works fine but when I try to add something public I get lost. Can someone tell me, if I want to add a public function in lbph_faces.cpp, what do I have to do? Which headerfiles do I have to update? Example: lbph_faces.cpp class LBPH : public LBPHFaceRecognizer { public: void test(); }; void LBPH::test() { std::cout

AttributeError: 'module' object has no attribute 'face' OS X

0
0
I'm trying to build opencv with opencv_contrib on OS X. I will explain step-by-step what I did: 1. I downloaded the OpenCV 3.1 from: http://opencv.org/downloads.html 2. I also downloaded the **opencv_contrib** from: https://github.com/Itseez/opencv_contrib 3. I put the **opencv_contrib** folder inside the opencv-3.1.0 folder 4. I created a folder called "**build**" inside the opencv-3.1.0 folder 5. From the terminal I went to the build folder: `/Users/kelvinsp/Downloads/opencv-3.1.0/build/` 6. Then I ran the following commands: `cmake -DOPENCV_EXTRA_MODULES_PATH=/Users/kelvinsp/Downloads/opencv-3.1.0/opencv_contrib/modules /Users/kelvinsp/Downloads/opencv-3.1.0/` `make -j5` `sudo make install` 7. Then, in the python terminal I tried to run the command: `import cv2` and receive the following error: `ImportError: No module named cv2` 8. Searching in stackoverflow, I found a solution and I ran the command: `export PYTHONPATH=/usr/local/lib/python2.7/site-packages/:$PYTHONPATH` 9. Now the import cv2 command is working, but when I ran the command `help(cv2.face)` I got the following error: `AttributeError: 'module' object has no attribute 'face'` Can someone help me please? I don't know what I'm doing wrong. ---------- cmake output: -- The CXX compiler identification is AppleClang 7.3.0.7030031 -- The C compiler identification is AppleClang 7.3.0.7030031 -- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Performing Test HAVE_CXX_FSIGNED_CHAR -- Performing Test HAVE_CXX_FSIGNED_CHAR - Success -- Performing Test HAVE_C_FSIGNED_CHAR -- Performing Test HAVE_C_FSIGNED_CHAR - Success -- Performing Test HAVE_CXX_W -- Performing Test HAVE_CXX_W - Success -- Performing Test HAVE_C_W -- Performing Test HAVE_C_W - Success -- Performing Test HAVE_CXX_WALL -- Performing Test HAVE_CXX_WALL - Failed -- Performing Test HAVE_C_WALL -- Performing Test HAVE_C_WALL - Failed -- Performing Test HAVE_CXX_WERROR_RETURN_TYPE -- Performing Test HAVE_CXX_WERROR_RETURN_TYPE - Success -- Performing Test HAVE_C_WERROR_RETURN_TYPE -- Performing Test HAVE_C_WERROR_RETURN_TYPE - Success -- Performing Test HAVE_CXX_WERROR_NON_VIRTUAL_DTOR -- Performing Test HAVE_CXX_WERROR_NON_VIRTUAL_DTOR - Success -- Performing Test HAVE_C_WERROR_NON_VIRTUAL_DTOR -- Performing Test HAVE_C_WERROR_NON_VIRTUAL_DTOR - Success -- Performing Test HAVE_CXX_WERROR_ADDRESS -- Performing Test HAVE_CXX_WERROR_ADDRESS - Success -- Performing Test HAVE_C_WERROR_ADDRESS -- Performing Test HAVE_C_WERROR_ADDRESS - Success -- Performing Test HAVE_CXX_WERROR_SEQUENCE_POINT -- Performing Test HAVE_CXX_WERROR_SEQUENCE_POINT - Success -- Performing Test HAVE_C_WERROR_SEQUENCE_POINT -- Performing Test HAVE_C_WERROR_SEQUENCE_POINT - Success -- Performing Test HAVE_CXX_WFORMAT -- Performing Test HAVE_CXX_WFORMAT - Success -- Performing Test HAVE_C_WFORMAT -- Performing Test HAVE_C_WFORMAT - Success -- Performing Test HAVE_CXX_WERROR_FORMAT_SECURITY -- Performing Test HAVE_CXX_WERROR_FORMAT_SECURITY - Success -- Performing Test HAVE_C_WERROR_FORMAT_SECURITY -- Performing Test HAVE_C_WERROR_FORMAT_SECURITY - Success -- Performing Test HAVE_CXX_WMISSING_DECLARATIONS -- Performing Test HAVE_CXX_WMISSING_DECLARATIONS - Success -- Performing Test HAVE_C_WMISSING_DECLARATIONS -- Performing Test HAVE_C_WMISSING_DECLARATIONS - Success -- Performing Test HAVE_CXX_WMISSING_PROTOTYPES -- Performing Test HAVE_CXX_WMISSING_PROTOTYPES - Success -- Performing Test HAVE_C_WMISSING_PROTOTYPES -- Performing Test HAVE_C_WMISSING_PROTOTYPES - Success -- Performing Test HAVE_CXX_WSTRICT_PROTOTYPES -- Performing Test HAVE_CXX_WSTRICT_PROTOTYPES - Success -- Performing Test HAVE_C_WSTRICT_PROTOTYPES -- Performing Test HAVE_C_WSTRICT_PROTOTYPES - Success -- Performing Test HAVE_CXX_WUNDEF -- Performing Test HAVE_CXX_WUNDEF - Success -- Performing Test HAVE_C_WUNDEF -- Performing Test HAVE_C_WUNDEF - Success -- Performing Test HAVE_CXX_WINIT_SELF -- Performing Test HAVE_CXX_WINIT_SELF - Success -- Performing Test HAVE_C_WINIT_SELF -- Performing Test HAVE_C_WINIT_SELF - Success -- Performing Test HAVE_CXX_WPOINTER_ARITH -- Performing Test HAVE_CXX_WPOINTER_ARITH - Success -- Performing Test HAVE_C_WPOINTER_ARITH -- Performing Test HAVE_C_WPOINTER_ARITH - Success -- Performing Test HAVE_CXX_WSHADOW -- Performing Test HAVE_CXX_WSHADOW - Success -- Performing Test HAVE_C_WSHADOW -- Performing Test HAVE_C_WSHADOW - Success -- Performing Test HAVE_CXX_WSIGN_PROMO -- Performing Test HAVE_CXX_WSIGN_PROMO - Success -- Performing Test HAVE_C_WSIGN_PROMO -- Performing Test HAVE_C_WSIGN_PROMO - Success -- Performing Test HAVE_CXX_WNO_NARROWING -- Performing Test HAVE_CXX_WNO_NARROWING - Success -- Performing Test HAVE_C_WNO_NARROWING -- Performing Test HAVE_C_WNO_NARROWING - Success -- Performing Test HAVE_CXX_WNO_DELETE_NON_VIRTUAL_DTOR -- Performing Test HAVE_CXX_WNO_DELETE_NON_VIRTUAL_DTOR - Success -- Performing Test HAVE_C_WNO_DELETE_NON_VIRTUAL_DTOR -- Performing Test HAVE_C_WNO_DELETE_NON_VIRTUAL_DTOR - Success -- Performing Test HAVE_CXX_WNO_UNNAMED_TYPE_TEMPLATE_ARGS -- Performing Test HAVE_CXX_WNO_UNNAMED_TYPE_TEMPLATE_ARGS - Success -- Performing Test HAVE_C_WNO_UNNAMED_TYPE_TEMPLATE_ARGS -- Performing Test HAVE_C_WNO_UNNAMED_TYPE_TEMPLATE_ARGS - Success -- Performing Test HAVE_CXX_FDIAGNOSTICS_SHOW_OPTION -- Performing Test HAVE_CXX_FDIAGNOSTICS_SHOW_OPTION - Success -- Performing Test HAVE_C_FDIAGNOSTICS_SHOW_OPTION -- Performing Test HAVE_C_FDIAGNOSTICS_SHOW_OPTION - Success -- Performing Test HAVE_CXX_WNO_LONG_LONG -- Performing Test HAVE_CXX_WNO_LONG_LONG - Success -- Performing Test HAVE_C_WNO_LONG_LONG -- Performing Test HAVE_C_WNO_LONG_LONG - Success -- Performing Test HAVE_CXX_QUNUSED_ARGUMENTS -- Performing Test HAVE_CXX_QUNUSED_ARGUMENTS - Success -- Performing Test HAVE_C_QUNUSED_ARGUMENTS -- Performing Test HAVE_C_QUNUSED_ARGUMENTS - Success -- Performing Test HAVE_CXX_WNO_SEMICOLON_BEFORE_METHOD_BODY -- Performing Test HAVE_CXX_WNO_SEMICOLON_BEFORE_METHOD_BODY - Success -- Performing Test HAVE_C_WNO_SEMICOLON_BEFORE_METHOD_BODY -- Performing Test HAVE_C_WNO_SEMICOLON_BEFORE_METHOD_BODY - Success -- Performing Test HAVE_CXX_FNO_OMIT_FRAME_POINTER -- Performing Test HAVE_CXX_FNO_OMIT_FRAME_POINTER - Success -- Performing Test HAVE_C_FNO_OMIT_FRAME_POINTER -- Performing Test HAVE_C_FNO_OMIT_FRAME_POINTER - Success -- Performing Test HAVE_CXX_MSSE -- Performing Test HAVE_CXX_MSSE - Success -- Performing Test HAVE_C_MSSE -- Performing Test HAVE_C_MSSE - Success -- Performing Test HAVE_CXX_MSSE2 -- Performing Test HAVE_CXX_MSSE2 - Success -- Performing Test HAVE_C_MSSE2 -- Performing Test HAVE_C_MSSE2 - Success -- Performing Test HAVE_CXX_MNO_AVX -- Performing Test HAVE_CXX_MNO_AVX - Success -- Performing Test HAVE_C_MNO_AVX -- Performing Test HAVE_C_MNO_AVX - Success -- Performing Test HAVE_CXX_MSSE3 -- Performing Test HAVE_CXX_MSSE3 - Success -- Performing Test HAVE_C_MSSE3 -- Performing Test HAVE_C_MSSE3 - Success -- Performing Test HAVE_CXX_MNO_SSSE3 -- Performing Test HAVE_CXX_MNO_SSSE3 - Success -- Performing Test HAVE_C_MNO_SSSE3 -- Performing Test HAVE_C_MNO_SSSE3 - Success -- Performing Test HAVE_CXX_MNO_SSE4_1 -- Performing Test HAVE_CXX_MNO_SSE4_1 - Success -- Performing Test HAVE_C_MNO_SSE4_1 -- Performing Test HAVE_C_MNO_SSE4_1 - Success -- Performing Test HAVE_CXX_MNO_SSE4_2 -- Performing Test HAVE_CXX_MNO_SSE4_2 - Success -- Performing Test HAVE_C_MNO_SSE4_2 -- Performing Test HAVE_C_MNO_SSE4_2 - Success -- Performing Test HAVE_CXX_FVISIBILITY_HIDDEN -- Performing Test HAVE_CXX_FVISIBILITY_HIDDEN - Success -- Performing Test HAVE_C_FVISIBILITY_HIDDEN -- Performing Test HAVE_C_FVISIBILITY_HIDDEN - Success -- Performing Test HAVE_CXX_FVISIBILITY_INLINES_HIDDEN -- Performing Test HAVE_CXX_FVISIBILITY_INLINES_HIDDEN - Success -- Performing Test HAVE_C_FVISIBILITY_INLINES_HIDDEN -- Performing Test HAVE_C_FVISIBILITY_INLINES_HIDDEN - Success -- Check if the system is big endian -- Searching 16 bit integer -- Looking for sys/types.h -- Looking for sys/types.h - found -- Looking for stdint.h -- Looking for stdint.h - found -- Looking for stddef.h -- Looking for stddef.h - found -- Check size of unsigned short -- Check size of unsigned short - done -- Using unsigned short -- Check if the system is big endian - little endian -- Looking for fseeko -- Looking for fseeko - found -- Looking for unistd.h -- Looking for unistd.h - found -- Check size of off64_t -- Check size of off64_t - failed -- Performing Test HAVE_C_WNO_SHORTEN_64_TO_32 -- Performing Test HAVE_C_WNO_SHORTEN_64_TO_32 - Success -- Performing Test HAVE_C_WNO_ATTRIBUTES -- Performing Test HAVE_C_WNO_ATTRIBUTES - Success -- Performing Test HAVE_C_WNO_STRICT_PROTOTYPES -- Performing Test HAVE_C_WNO_STRICT_PROTOTYPES - Success -- Performing Test HAVE_C_WNO_MISSING_PROTOTYPES -- Performing Test HAVE_C_WNO_MISSING_PROTOTYPES - Success -- Performing Test HAVE_C_WNO_MISSING_DECLARATIONS -- Performing Test HAVE_C_WNO_MISSING_DECLARATIONS - Success -- Looking for assert.h -- Looking for assert.h - found -- Looking for fcntl.h -- Looking for fcntl.h - found -- Looking for io.h -- Looking for io.h - not found -- Looking for jbg_newlen -- Looking for jbg_newlen - not found -- Looking for mmap -- Looking for mmap - found -- Looking for search.h -- Looking for search.h - found -- Looking for string.h -- Looking for string.h - found -- Looking for unistd.h -- Looking for unistd.h - found -- Performing Test HAVE_C_WNO_UNUSED_BUT_SET_VARIABLE -- Performing Test HAVE_C_WNO_UNUSED_BUT_SET_VARIABLE - Failed -- Performing Test HAVE_C_WNO_UNDEF -- Performing Test HAVE_C_WNO_UNDEF - Success -- Performing Test HAVE_C_WNO_UNUSED -- Performing Test HAVE_C_WNO_UNUSED - Success -- Performing Test HAVE_C_WNO_SIGN_COMPARE -- Performing Test HAVE_C_WNO_SIGN_COMPARE - Success -- Performing Test HAVE_C_WNO_CAST_ALIGN -- Performing Test HAVE_C_WNO_CAST_ALIGN - Success -- Performing Test HAVE_C_WNO_SHADOW -- Performing Test HAVE_C_WNO_SHADOW - Success -- Performing Test HAVE_C_WNO_MAYBE_UNINITIALIZED -- Performing Test HAVE_C_WNO_MAYBE_UNINITIALIZED - Failed -- Performing Test HAVE_C_WNO_POINTER_TO_INT_CAST -- Performing Test HAVE_C_WNO_POINTER_TO_INT_CAST - Success -- Performing Test HAVE_C_WNO_INT_TO_POINTER_CAST -- Performing Test HAVE_C_WNO_INT_TO_POINTER_CAST - Success -- Performing Test HAVE_C_WNO_UNUSED_PARAMETER -- Performing Test HAVE_C_WNO_UNUSED_PARAMETER - Success -- Performing Test HAVE_CXX_WNO_MISSING_DECLARATIONS -- Performing Test HAVE_CXX_WNO_MISSING_DECLARATIONS - Success -- Performing Test HAVE_CXX_WNO_UNUSED_PARAMETER -- Performing Test HAVE_CXX_WNO_UNUSED_PARAMETER - Success -- Performing Test HAVE_C_WNO_UNUSED_VARIABLE -- Performing Test HAVE_C_WNO_UNUSED_VARIABLE - Success -- Performing Test HAVE_C_WNO_UNUSED_FUNCTION -- Performing Test HAVE_C_WNO_UNUSED_FUNCTION - Success -- Performing Test HAVE_C_WNO_IMPLICIT_FUNCTION_DECLARATION -- Performing Test HAVE_C_WNO_IMPLICIT_FUNCTION_DECLARATION - Success -- Performing Test HAVE_C_WNO_UNINITIALIZED -- Performing Test HAVE_C_WNO_UNINITIALIZED - Success -- Performing Test HAVE_C_WNO_UNUSED_BUT_SET_PARAMETER -- Performing Test HAVE_C_WNO_UNUSED_BUT_SET_PARAMETER - Failed -- Performing Test HAVE_C_WNO_STRICT_OVERFLOW -- Performing Test HAVE_C_WNO_STRICT_OVERFLOW - Success -- Looking for semaphore.h -- Looking for semaphore.h - found -- Performing Test HAVE_CXX_WNO_SHADOW -- Performing Test HAVE_CXX_WNO_SHADOW - Success -- Performing Test HAVE_CXX_WNO_UNUSED -- Performing Test HAVE_CXX_WNO_UNUSED - Success -- Performing Test HAVE_CXX_WNO_SIGN_COMPARE -- Performing Test HAVE_CXX_WNO_SIGN_COMPARE - Success -- Performing Test HAVE_CXX_WNO_UNDEF -- Performing Test HAVE_CXX_WNO_UNDEF - Success -- Performing Test HAVE_CXX_WNO_UNINITIALIZED -- Performing Test HAVE_CXX_WNO_UNINITIALIZED - Success -- Performing Test HAVE_CXX_WNO_SWITCH -- Performing Test HAVE_CXX_WNO_SWITCH - Success -- Performing Test HAVE_CXX_WNO_PARENTHESES -- Performing Test HAVE_CXX_WNO_PARENTHESES - Success -- Performing Test HAVE_CXX_WNO_ARRAY_BOUNDS -- Performing Test HAVE_CXX_WNO_ARRAY_BOUNDS - Success -- Performing Test HAVE_CXX_WNO_EXTRA -- Performing Test HAVE_CXX_WNO_EXTRA - Success -- Performing Test HAVE_CXX_WNO_DEPRECATED_DECLARATIONS -- Performing Test HAVE_CXX_WNO_DEPRECATED_DECLARATIONS - Success -- Checking for module 'gstreamer-base-1.0' -- No package 'gstreamer-base-1.0' found -- Checking for module 'gstreamer-video-1.0' -- No package 'gstreamer-video-1.0' found -- Checking for module 'gstreamer-app-1.0' -- No package 'gstreamer-app-1.0' found -- Checking for module 'gstreamer-riff-1.0' -- No package 'gstreamer-riff-1.0' found -- Checking for module 'gstreamer-pbutils-1.0' -- No package 'gstreamer-pbutils-1.0' found -- Checking for module 'gstreamer-base-0.10' -- No package 'gstreamer-base-0.10' found -- Checking for module 'gstreamer-video-0.10' -- No package 'gstreamer-video-0.10' found -- Checking for module 'gstreamer-app-0.10' -- No package 'gstreamer-app-0.10' found -- Checking for module 'gstreamer-riff-0.10' -- No package 'gstreamer-riff-0.10' found -- Checking for module 'gstreamer-pbutils-0.10' -- No package 'gstreamer-pbutils-0.10' found -- Checking for module 'libdc1394-2' -- No package 'libdc1394-2' found -- Checking for module 'libdc1394' -- No package 'libdc1394' found -- Checking for module 'libv4l1' -- No package 'libv4l1' found -- Checking for module 'libv4l2' -- No package 'libv4l2' found -- Looking for linux/videodev.h -- Looking for linux/videodev.h - not found -- Looking for linux/videodev2.h -- Looking for linux/videodev2.h - not found -- Looking for sys/videoio.h -- Looking for sys/videoio.h - not found -- Checking for module 'libavcodec' -- No package 'libavcodec' found -- Checking for module 'libavformat' -- No package 'libavformat' found -- Checking for module 'libavutil' -- No package 'libavutil' found -- Checking for module 'libswscale' -- No package 'libswscale' found -- Checking for module 'libavresample' -- No package 'libavresample' found -- Looking for libavformat/avformat.h -- Looking for libavformat/avformat.h - not found -- Looking for ffmpeg/avformat.h -- Looking for ffmpeg/avformat.h - not found -- Checking for module 'libgphoto2' -- No package 'libgphoto2' found -- ICV: Downloading ippicv_macosx_20151201.tgz... -- ICV: Unpacking ippicv_macosx_20151201.tgz to /Users/kelvinsp/Downloads/opencv-3.1.0/3rdparty/ippicv/unpack... -- ICV: Package successfully downloaded -- found IPP (ICV version): 9.0.1 [9.0.1] -- at: /Users/kelvinsp/Downloads/opencv-3.1.0/3rdparty/ippicv/unpack/ippicv_osx -- Found Doxygen: /usr/local/bin/doxygen (found version "1.8.11") -- To enable PlantUML support, set PLANTUML_JAR environment variable or pass -DPLANTUML_JAR= option to cmake -- Found PythonInterp: /opt/local/bin/python2.7 (found suitable version "2.7.11", minimum required is "2.7") -- Could NOT find PythonLibs: Found unsuitable version "2.7.10", but required is exact version "2.7.11" (found /usr/lib/libpython2.7.dylib) Traceback (most recent call last): File "", line 1, in ImportError: No module named numpy.distutils -- Could NOT find PythonInterp: Found unsuitable version "2.7.10", but required is at least "3.4" (found /usr/bin/python) -- Could NOT find PythonInterp: Found unsuitable version "2.7.10", but required is at least "3.2" (found /usr/bin/python) Unable to find any JVMs matching version "(null)". No Java runtime present, try --request to install. -- Found JNI: /System/Library/Frameworks/JavaVM.framework -- Could NOT find Matlab (missing: MATLAB_MEX_SCRIPT MATLAB_INCLUDE_DIRS MATLAB_ROOT_DIR MATLAB_LIBRARIES MATLAB_LIBRARY_DIRS MATLAB_MEXEXT MATLAB_ARCH MATLAB_BIN) -- VTK is not found. Please set -DVTK_DIR in CMake to VTK build directory, or to VTK install subdirectory with VTKConfig.cmake file -- Caffe: NO -- Protobuf: NO -- Glog: NO -- Could NOT find HDF5 (missing: HDF5_LIBRARIES HDF5_INCLUDE_DIRS) -- Checking SFM deps... FALSE -- Module opencv_sfm disabled because the following dependencies are not found: Eigen Glog/Gflags -- Assume that non-module dependency is available: -framework OpenCL (for module opencv_core) -- Performing Test HAVE_CXX_WNO_MAYBE_UNINITIALIZED -- Performing Test HAVE_CXX_WNO_MAYBE_UNINITIALIZED - Failed -- Performing Test HAVE_CXX_WNO_SIGN_PROMO -- Performing Test HAVE_CXX_WNO_SIGN_PROMO - Success -- Performing Test HAVE_CXX_WNO_MISSING_PROTOTYPES -- Performing Test HAVE_CXX_WNO_MISSING_PROTOTYPES - Success -- Looking for pthread.h -- Looking for pthread.h - found -- Looking for pthread_create -- Looking for pthread_create - found -- Found Threads: TRUE -- Could NOT find Protobuf (missing: PROTOBUF_LIBRARY PROTOBUF_INCLUDE_DIR) -- Build libprotobuf from sources: -- libprotobuf not found into system -- The protocol buffer compiler not found -- Looking for include file pthread.h -- Looking for include file pthread.h - found -- Looking for C++ include unordered_map -- Looking for C++ include unordered_map - found -- Looking for C++ include tr1/unordered_map -- Looking for C++ include tr1/unordered_map - not found -- Looking for C++ include unordered_set -- Looking for C++ include unordered_set - found -- Looking for C++ include tr1/unordered_set -- Looking for C++ include tr1/unordered_set - not found -- Performing Test HAVE_CXX_WNO_DEPRECATED -- Performing Test HAVE_CXX_WNO_DEPRECATED - Success -- Performing Test HAVE_CXX_WNO_UNUSED_LOCAL_TYPEDEFS -- Performing Test HAVE_CXX_WNO_UNUSED_LOCAL_TYPEDEFS - Success -- Performing Test HAVE_CXX_WNO_TAUTOLOGICAL_UNDEFINED_COMPARE -- Performing Test HAVE_CXX_WNO_TAUTOLOGICAL_UNDEFINED_COMPARE - Success -- Performing Test HAVE_OBJCXX_FOBJC_EXCEPTIONS -- Performing Test HAVE_OBJCXX_FOBJC_EXCEPTIONS - Success -- Tesseract: NO -- -- General configuration for OpenCV 3.1.0 ===================================== -- Version control: unknown -- -- Platform: -- Host: Darwin 15.5.0 x86_64 -- CMake: 3.5.2 -- CMake generator: Unix Makefiles -- CMake build tool: /usr/bin/make -- Configuration: Release -- -- C/C++: -- Built as dynamic libs?: YES -- C++ Compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ (ver 7.3.0.7030031) -- C++ flags (Release): -fsigned-char -W -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -fdiagnostics-show-option -Wno-long-long -Qunused-arguments -Wno-semicolon-before-method-body -fno-omit-frame-pointer -msse -msse2 -mno-avx -msse3 -mno-ssse3 -mno-sse4.1 -mno-sse4.2 -fvisibility=hidden -fvisibility-inlines-hidden -O3 -DNDEBUG -DNDEBUG -- C++ flags (Debug): -fsigned-char -W -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -fdiagnostics-show-option -Wno-long-long -Qunused-arguments -Wno-semicolon-before-method-body -fno-omit-frame-pointer -msse -msse2 -mno-avx -msse3 -mno-ssse3 -mno-sse4.1 -mno-sse4.2 -fvisibility=hidden -fvisibility-inlines-hidden -g -O0 -DDEBUG -D_DEBUG -- C Compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- C flags (Release): -fsigned-char -W -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -fdiagnostics-show-option -Wno-long-long -Qunused-arguments -Wno-semicolon-before-method-body -fno-omit-frame-pointer -msse -msse2 -mno-avx -msse3 -mno-ssse3 -mno-sse4.1 -mno-sse4.2 -fvisibility=hidden -fvisibility-inlines-hidden -O3 -DNDEBUG -DNDEBUG -- C flags (Debug): -fsigned-char -W -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -fdiagnostics-show-option -Wno-long-long -Qunused-arguments -Wno-semicolon-before-method-body -fno-omit-frame-pointer -msse -msse2 -mno-avx -msse3 -mno-ssse3 -mno-sse4.1 -mno-sse4.2 -fvisibility=hidden -fvisibility-inlines-hidden -g -O0 -DDEBUG -D_DEBUG -- Linker flags (Release): -- Linker flags (Debug): -- Precompiled headers: NO -- Extra dependencies: -framework OpenCL -framework Cocoa -framework QTKit -framework QuartzCore -framework AppKit -- 3rdparty dependencies: libjpeg libwebp libpng libtiff libjasper IlmImf zlib libprotobuf -- -- OpenCV modules: -- To be built: core flann imgproc ml photo reg surface_matching video dnn fuzzy imgcodecs shape videoio highgui objdetect plot superres ts xobjdetect xphoto bgsegm bioinspired dpm face features2d line_descriptor saliency text calib3d ccalib datasets rgbd stereo structured_light tracking videostab xfeatures2d ximgproc aruco optflow stitching -- Disabled: world contrib_world -- Disabled by dependency: - -- Unavailable: cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev java python2 python3 viz cvv hdf matlab sfm -- -- GUI: -- QT: NO -- Cocoa: YES -- OpenGL support: NO -- VTK support: NO -- -- Media I/O: -- ZLib: build (ver 1.2.8) -- JPEG: build (ver 90) -- WEBP: build (ver 0.3.1) -- PNG: build (ver 1.6.19) -- TIFF: build (ver 42 - 4.0.2) -- JPEG 2000: build (ver 1.900.1) -- OpenEXR: build (ver 1.7.1) -- GDAL: NO -- -- Video I/O: -- DC1394 1.x: NO -- DC1394 2.x: NO -- FFMPEG: NO -- codec: NO -- format: NO -- util: NO -- swscale: NO -- resample: NO -- gentoo-style: NO -- GStreamer: NO -- OpenNI: NO -- OpenNI PrimeSensor Modules: NO -- OpenNI2: NO -- PvAPI: NO -- GigEVisionSDK: NO -- QuickTime: NO -- QTKit: YES -- V4L/V4L2: NO/NO -- XIMEA: NO -- gPhoto2: NO -- -- Parallel framework: GCD -- -- Other third-party libraries: -- Use IPP: 9.0.1 [9.0.1] -- at: /Users/kelvinsp/Downloads/opencv-3.1.0/3rdparty/ippicv/unpack/ippicv_osx -- Use IPP Async: NO -- Use VA: NO -- Use Intel VA-API/OpenCL: NO -- Use Eigen: NO -- Use Cuda: NO -- Use OpenCL: YES -- Use custom HAL: NO -- -- OpenCL: -- Version: static -- libraries: -framework OpenCL -- Use AMDFFT: NO -- Use AMDBLAS: NO -- -- Python 2: -- Interpreter: /opt/local/bin/python2.7 (ver 2.7.11) -- -- Python 3: -- Interpreter: NO -- -- Python (for build): /opt/local/bin/python2.7 -- -- Java: -- ant: NO -- JNI: /System/Library/Frameworks/JavaVM.framework/Headers /System/Library/Frameworks/JavaVM.framework/Headers /System/Library/Frameworks/JavaVM.framework/Headers -- Java wrappers: NO -- Java tests: NO -- -- Matlab: Matlab not found or implicitly disabled -- -- Documentation: -- Doxygen: /usr/local/bin/doxygen (ver 1.8.11) -- PlantUML: NO -- -- Tests and samples: -- Tests: YES -- Performance tests: YES -- C/C++ Examples: NO -- -- Install path: /usr/local -- -- cvconfig.h is in: /Users/kelvinsp/Downloads/opencv-3.1.0/build -- ----------------------------------------------------------------- -- -- Configuring done -- Generating done -- Build files have been written to: /Users/kelvinsp/Downloads/opencv-3.1.0/build

QT 'emit': undeclared identifier error after included

0
0
I'm using OpenCV with QT and trying to implement facial recognition but as soon as I include `` from the "contrib" branch, QT complains about `error: C2065: 'emit': undeclared identifier`. I've tried including `"qobjectdefs.h"` and `#define emit` at the top of the appropriate header file, but it does not work. Code: **Header** #ifndef FACEDETECTOR_H #define FACEDETECTOR_H #include #include #include #include #include #include #include #include #include //This causes the error as soon as I uncomment it #include #include class FaceDetector : public QObject { Q_OBJECT public: FaceDetector(QObject *parent=0) : QObject(parent), processAll_(true) {} void setProcessAll(bool all); ~FaceDetector(); signals: void image_signal(const QImage&); public slots: void processFrame(const cv::Mat& frame); void facecascade_filename(QString filename); private: QString facecascade_filename_; QString eyecascade_filename_; QBasicTimer timer_; QVector<:mat> m_CSVimages; QVector m_CSVlabels; cv::Mat frame_; bool processAll_; cv::CascadeClassifier faceCascade; cv::CascadeClassifier eyeCascade; //I need face.hpp for this: //cv::Ptr<:face::facerecognizer> m_faceModel; void process(cv::Mat frame); void loadFiles(const cv::String& faceCascadeFilename, const cv::String& eyesCascadeFilename); static void loadCSV(const cv::String& filePath, QVector<:mat>& images, QVector& labels, char separator = ';'); void queue(const cv::Mat & frame); void timerEvent(QTimerEvent* ev); static void matDeleter(void* mat); }; #endif // FACEDETECTOR_H **Implementation** Other functions omitted for brevity #include "faceDetector.h" void FaceDetector::process(cv::Mat frame) { cv::Mat grey_image; cv::cvtColor(frame, grey_image, CV_BGR2GRAY); cv::equalizeHist(grey_image, grey_image); std::vector<:rect> faces; // Calculate the camera size and set the size to 1/8 of screen height faceCascade.detectMultiScale(grey_image, faces, 1.1, 8, 0|CV_HAAR_SCALE_IMAGE, cv::Size(frame.cols/4, frame.rows/4)); // Minimum size of obj //-- Draw rectangles around faces for( size_t i = 0; i (frame.data), frame.cols, frame.rows, frame.step, QImage::Format_RGB888, &matDeleter, new cv::Mat(frame)); image.rgbSwapped(); Q_ASSERT(image.constBits() == frame.data); //This is the error location emit image_signal(image); }

What is the difference between Stump-based and Tree-based frontal face detector?

0
0
In the Opencv there are some haar cascades: - haarcascade_frontalface_alt.xml - Stump-based 20x20 gentle adaboost frontal face detector. Created by Rainer Lienhart. - haarcascade_frontalface_alt2.xml - Tree-based 20x20 gentle adaboost frontal face detector. Created by Rainer Lienhart. What is the difference between Stump-based and Tree-based frontal face detector? Inipractice, they give very similar results.

Face Detection Error OpenCV 3.1.0

0
0
I am trying to get started in opneCv and get learning but am running into problems in regards to face detection the code I have should detect faces I believe my linkages are fine can someone please help me understand what I'm doing wrong? full code in both main.cpp and project.pro file is provided below **App Output:** *starting /Users/admin/Desktop/build-Origin-Desktop_Qt_5_6_0_clang_64bit-Debug/Origin.app/Contents/MacOS/Origin... OpenCV Error: Assertion failed (!empty()) in detectMultiScale, file /Users/admin/Desktop/opencv-3.1.0/modules/objdetect/src/cascadedetect.cpp, line 1639 Cleaned up camera. Unable to initiate camera /Users/admin/Desktop/build-Origin-Desktop_Qt_5_6_0_clang_64bit-Debug/Origin.app/Contents/MacOS/Origin exited with code 0* **Compile Output:** *10:46:41: Running steps for project Origin... 10:46:41: Configuration unchanged, skipping qmake step. 10:46:41: Starting: "/usr/bin/make" /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -c -pipe -stdlib=libc++ -g -std=gnu++11 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -mmacosx-version-min=10.7 -Wall -W -fPIC -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../Origin -I. -I/usr/local/include -I../../Qt/5.6/clang_64/lib/QtWidgets.framework/Headers -I../../Qt/5.6/clang_64/lib/QtGui.framework/Headers -I../../Qt/5.6/clang_64/lib/QtCore.framework/Headers -I. -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/OpenGL.framework/Headers -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/AGL.framework/Headers -I. -I../../Qt/5.6/clang_64/mkspecs/macx-clang -F/Users/admin/Qt/5.6/clang_64/lib -o main.o ../Origin/main.cpp /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -headerpad_max_install_names -stdlib=libc++ -Wl,-syslibroot,/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -mmacosx-version-min=10.7 -Wl,-rpath,/Users/travishaycock/Qt/5.6/clang_64/lib -o Origin.app/Contents/MacOS/Origin main.o mainwindow.o moc_mainwindow.o -F/Users/admin/Qt/5.6/clang_64/lib -L/usr/local/lib -lopencv_core -lopencv_highgui -lopencv_videoio -lopencv_imgproc -lopencv_objdetect -framework QtWidgets -framework QtGui -framework QtCore -framework OpenGL -framework AGL 10:46:43: The process "/usr/bin/make" exited normally. 10:46:43: Elapsed time: 00:02.* **Main.cpp File** #include "mainwindow.h" #include #include #include #include #include #include #include #include #include #include using namespace cv; using namespace std; CascadeClassifier face_cascade, eyes_cascade; String window_name = "Face Detection"; /** * Detects faces */ void detectFaces(Mat frame) { std::vector faces; Mat frame_gray; cvtColor(frame, frame_gray, COLOR_BGR2GRAY); // Convert to gray scale equalizeHist(frame_gray, frame_gray); // Equalize histogram // Detect faces face_cascade.detectMultiScale(frame_gray, faces, 1.1, 3, 0|CASCADE_SCALE_IMAGE, Size(30, 30)); // Iterate over all of the faces for(size_t i = 0; i eyes; // Try to detect eyes, inside each face eyes_cascade.detectMultiScale(face, eyes, 1.1, 2, 0 |CASCADE_SCALE_IMAGE, Size(30, 30) ); // Check to see if eyes inside of face, if so, draw ellipse around face if(eyes.size() > 0) ellipse(frame, center, Size(faces[i].width/2, faces[i].height/2), 0, 0, 360, Scalar( 255, 0, 255 ), 4, 8, 0 ); } imshow( window_name, frame ); } int main(int argc, char *argv[]){ QApplication a(argc, argv); MainWindow w; // cam code try{ VideoCapture cap(0); // Open default camera Mat frame; // Load preconstructed classifier face_cascade.load("haarcascade_frontalface_alt.xml"); while(cap.read(frame)) { detectFaces(frame); // Call function to detect faces if( waitKey(30) >= 0) // Pause key break; } return 0; }catch(Exception ex){ std::cout

OpenCV Contrib Face module with Java wrapper - returning multiple predictions

0
0
I'm using [OpenCV Contrib Face module](https://github.com/Itseez/opencv_contrib/tree/master/modules/face) in Java. Java wrapper is automatically generated from C++ source code based on [`CV_WRAP`](http://answers.opencv.org/question/6528/cv_wrap-and-cv_exports_w/) tag. So far so good, **but** unfortunately not all methods I need have wrappers. :-( I'm using `FaceRecognizer.predict` method which returns label of face that is most similar (in terms of [eigenfaces](https://en.wikipedia.org/wiki/Eigenface)) to given face. What I desperately need is to get `N>1` (for example `N=5`) best matches, ie. `N` images with minimal [`PredictResult.distance`](https://github.com/Itseez/opencv_contrib/blob/master/modules/face/include/opencv2/face/predict_collector.hpp#L88). This is automatically generated Java's wrapper for `predict` method: // // C++: void predict(Mat src, int& label, double& confidence) // //javadoc: FaceRecognizer::predict(src, label, confidence) public void predict(Mat src, int[] label, double[] confidence) { double[] label_out = new double[1]; double[] confidence_out = new double[1]; predict_1(nativeObj, src.nativeObj, label_out, confidence_out); if(label!=null) label[0] = (int)label_out[0]; if(confidence!=null) confidence[0] = (double)confidence_out[0]; return; } As you can see, it uses two arrays (`label_out` and `confidence_out`) of length equal `1`. I need more generalized version which is available in C++ source code as a [`StandardCollector::getResults`](https://github.com/Itseez/opencv_contrib/blob/master/modules/face/src/predict_collector.cpp#L87) method. Is there an easy way to add a few [`CV_WRAP`](http://answers.opencv.org/question/6528/cv_wrap-and-cv_exports_w/) *'here and there'* to get multiple predictions using Java wrapper for: std::vector> StandardCollector::getResults(bool sorted) const { std::vector> res(data.size()); std::transform(data.begin(), data.end(), res.begin(), &toPair); if (sorted) { std::sort(res.begin(), res.end(), &pairLess); } return res; } ? Thanks in advance!

Face Detection example how to run in android 64 bits

0
0
RHi, I runned face detection example in a android 32 bits without problem, but i want to run it in a android 64 bits, but show error at loading opencv library, is there a way? thnks. Regards, Juan

Accesing MS Access Face Database using OpenCV C++

0
0
Hello everyone, I am definitely new in OpenCV. I am current working on an automated attendance management system using face recognition. I completed the face detection part, now working on how to implement the recognition part. I already developed my Face Database (which will be compared with the detected faces), so are there any good tutorials, demo code or links that could guide me to write the c++ code to read and write images from and to the MS access database? Thanking you in advance,

OpenCV Developer for Project needed

0
0
HI, I am afraid this is not the right place to ask, but maybe someone can reference me to a good place. My company develop Solutions to create customized Photobook Solutions. Some years ago we integrated a Third Party SDK to analyse a set of images to do the following: - Analyse if images show the same or similar objects/scenery - How many faces are on the image if any (only the number) - Analyse the image and rate the quality of the image (sharpness, noise, contrast). The result was each image was rated regarding quality and group the images that show same/similar objects. WE use this input to create automatic photobooks for example. We looking now for a software developer with OpenCV Experience that develop for us / with us this from scratch, because i do not think there existing ready-to-go SDKs doing this. Enviroment would be C/C++ for use on Windows/Mac/Linux as part of a Qt Framework Solution. Did anyone interest to work with us on that as part of a contract? best regards Frank

Facelandmarking

0
0
I am using DLib, which is very similar to OpenCV. I would like to detect different parts ( lips , nose) etc with it. Can anyone help.

OpenCV Developer for Project needed

0
0
HI, I am afraid this is not the right place to ask, but maybe someone can reference me to a good place. My company develop Solutions to create customized Photobook Solutions. Some years ago we integrated a Third Party SDK to analyse a set of images to do the following: - Analyse if images show the same or similar objects/scenery - How many faces are on the image if any (only the number) - Analyse the image and rate the quality of the image (sharpness, noise, contrast). The result was each image was rated regarding quality and group the images that show same/similar objects. WE use this input to create automatic photobooks for example. We looking now for a software developer with OpenCV Experience that develop for us / with us this from scratch, because i do not think there existing ready-to-go SDKs doing this. Enviroment would be C/C++ for use on Windows/Mac/Linux as part of a Qt Framework Solution. Did anyone interest to work with us on that as part of a contract? best regards Frank

Improving face recognition accuracy

0
0
I'm working on a Face Recognition program using `Opencv 3.1` with `Python 3` on `Linux` and I'm trying to increase recognition accuracy as much as I can. **My issue:** The confidence values between *Person A* (myself) and *Person B* (a friend) are a bit too close. There is a "fair" amount of difference, but not enough to set a threshold without getting false positives/negatives. I wrote a script to recognize *Person A* over a set of images for *Person B* and calculate the average confidence so I could see how much they differ by, and I noticed that as the face size in Step 3 of Preprocessing (see below) **increased**, the difference **decreased**. My expectation was that by **increasing** the face size, there would be more detail and thus the difference would **increase**. Detected face sizes in this case were roughly `1500x1500`. **My question:** How can I improve face recognition accuracy? Below is some information about my project. Thanks. ---------- Files used: - OpenCV's Haar Cascade (`haarcascade_frontalface_default.xml`) with a `scaleFactor` of `1.1` and `minNeighbors` of `10` for detecting faces. - Local Binary Patterns Histograms algorithm (`createLBPHFaceRecognizer`) for recognizing faces. ---------- Image information: - Each `4928x3264` - Same lighting conditions - Different facial expressions - Different angles (heads tilting / facing different directions) ---------- Preprocessing Steps: 1. Cropping the face out of the whole image 2. Converting it to grayscale 3. Resizing it to a "standard" size 4. Histogram Equalization to smooth out lighting differences 5. Applying a Bilateral Filter to smooth out small details ---------- Training Steps: 1. Preprocess raw images for a given person 2. Train recognizer using preprocessed faces 3. Save trained recognizer model to a file ---------- Recognition Steps: 1. Load recognizer model from file 2. Take in image from either file or webcam 3. Detect face 4. Preprocess face (see above) 5. Attempt recognition

Help: Face Recognition using LBP confused with unknown Faces

0
0
Hello everyone, I try to use this face recognition code below which I found on one of the Opencv documentation, but I have a problem when a new person face who is not in the recognition database is compared, the program confused saying this face is Mr.X or Mr.y or Mr.z who are already in the database. It works fine if face of the person to be compared is already in the face recognition database. Please people, your help will kindly be appreciated. #include "opencv2/core/core.hpp" #include "opencv2/contrib/contrib.hpp" #include "opencv2/highgui/highgui.hpp" #include #include #include using namespace cv; using namespace std; static void read_csv(const string& filename, vector& images, vector& labels, char separator = ';') { std::ifstream file(filename.c_str(), ifstream::in); if (!file) { string error_message = "No valid input file was given, please check the given filename."; CV_Error(CV_StsBadArg, error_message); } string line, path, classlabel; while (getline(file, line)) { stringstream liness(line); getline(liness, path, separator); getline(liness, classlabel); if(!path.empty() && !classlabel.empty()) { images.push_back(imread(path, 0)); labels.push_back(atoi(classlabel.c_str())); } } } int main(int argc, const char *argv[]) { // Check for valid command line arguments, print usage // if no arguments were given. if (argc != 2) { cout " images; vector labels; // Read in the data. This can fail if no valid // input filename is given. try { read_csv(fn_csv, images, labels); } catch (cv::Exception& e) { cerr model = createLBPHFaceRecognizer(); model->train(images, labels); // The following line predicts the label of a given // test image: int predictedLabel = model->predict(testSample); // // To get the confidence of a prediction call the model with: // // int predictedLabel = -1; // double confidence = 0.0; // model->predict(testSample, predictedLabel, confidence); // string result_message = format("Predicted class = %d / Actual class = %d.", predictedLabel, testLabel); cout set("threshold", 0.0); // Now the threshold of this model is set to 0.0. A prediction // now returns -1, as it's impossible to have a distance below // it predictedLabel = model->predict(testSample); cout getInt("radius"), model->getInt("neighbors"), model->getInt("grid_x"), model->getInt("grid_y"), model->getDouble("threshold")); cout histograms = model->getMatVector("histograms"); // But should I really visualize it? Probably the length is interesting: cout

Fastest way to track multiple faces?

0
0
Hi, everyone! I am doing a project that the program can detect faces in the video. And you know in detection, it could not always find a face during the whole process, so i want to use tracking to help me detect the face. The problem is even i use the KCF algorithm to track multiple faces, the time would be more and more depending on the number of the faces. Therefore, i'd like to know if there any other way to track multiple faces in a short time?

To distinguish a false face from the real face

0
0
Hello to everyone, I have a questition for face recognition How do I distinguish a real human face from a photo? Is something like this possible? This is really important for face verification. I developed an application, I can face recognition with this application, but as it is here, the people in the photo accept it in the hundreds. (https://youtu.be/0wxWdCc_TFo?t=14)

Face Recognition

0
0
i want to write a program which can compare a real time face with the saved photos in the database. Something like this but in Java: https://youtu.be/yFSPnu6_TZY
Viewing all 53 articles
Browse latest View live




Latest Images