Ask Your Question
0

OpenCv with contrib

asked 2017-04-21 13:50:47 -0600

talam gravatar image

updated 2017-04-21 13:56:57 -0600

LBerger gravatar image

i followed a tutorial by ZHAJOR in building opencv with the extra modules i couldnt post the link so the tutorial is titled INSTALL OPENCV AND MAKE A TEST PROJECT WITH CLION i should also mention that i did build it with homebrew too i got no errors using the face recognizer in the extra modules

#include <opencv2/face.hpp>
.
.
cv::Ptr <cv::face::FaceRecognizer> model = cv::face::createLBPHFaceRecognizer();

, but whenever i #include opencv2/contrib/contrib.hpp i got a fatal error im using c++ with opencv 3.2

edit retag flag offensive close merge delete

Comments

and fatal error is ? can you post cmakelists.txt please use 101010 button to preformat code

LBerger gravatar imageLBerger ( 2017-04-21 13:57:51 -0600 )edit
1

cmake_minimum_required(VERSION 3.6)

project(Testextra)
find_package(OpenCV REQUIRED)


set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")

set(SOURCE_FILES main.cpp)
add_executable(Testextra ${SOURCE_FILES})

include_directories(${OpenCV_INCLUDE_DIRS})
target_link_libraries(Testextra ${OpenCV_LIBS})

the error it gives is

In file included from /Users/me/ClionProjects/Testextra/adaptiveskindetector.hpp:4:
/Users/me/ClionProjects/Testextra/OpenCVCommon.hpp:38:10: fatal error: 'opencv2/contrib/contrib.hpp' file not found

#include "opencv2/contrib/contrib.hpp"
talam gravatar imagetalam ( 2017-04-21 14:06:39 -0600 )edit

sorry cmakelists ouput when you build opencv and opencv_contrib

LBerger gravatar imageLBerger ( 2017-04-21 14:23:02 -0600 )edit

where do i find it ?

talam gravatar imagetalam ( 2017-04-21 14:34:37 -0600 )edit

when you run :

cmake -DOPENCV_EXTRA_MODULES_PATH=<opencv_contrib>/modules <opencv_source_directory>

in output you must find something like

--   OpenCV modules:
--     To be built:                 cudev core cudaarithm flann imgproc ml objdetect phase_unwrapping plot reg surface_matching video xphoto bgsegm cudabgsegm cudafilters cudaimgproc cudawarping dnn face fuzzy imgcodecs photo shape videoio xobjdetect cudacodec highgui ts bioinspired dpm features2d line_descriptor saliency text calib3d ccalib cudafeatures2d cudalegacy cudaobjdetect cudaoptflow cudastereo datasets rgbd stereo structured_light superres tracking videostab xfeatures2d ximgproc aruco optflow stitching
LBerger gravatar imageLBerger ( 2017-04-21 14:43:32 -0600 )edit

OpenCV modules:

    --     To be built:                 core flann imgproc ml objdetect phase_unwrapping photo plot reg surface_matching video xphoto bgsegm dnn face fuzzy 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 stitching matlab

--     Disabled:                    world contrib_world
--     Disabled by dependency:      -
--     Unavailable:                 cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev python2 python3 viz cnn_3dobj cvv dnn_modern freetype hdf sfm matlab
talam gravatar imagetalam ( 2017-04-21 15:32:12 -0600 )edit

if your code is included in https://github.com/pi19404/OpenVision you cannot use opencv 3.2.

To test your install you can copy this source code and it should be OK if your install is good

LBerger gravatar imageLBerger ( 2017-04-21 15:42:58 -0600 )edit

can you please explain why cant i use the openvision libraries ? is it because there's no opencv2/contrib/contrib.hpp anymore in the opencv 3.2 version?

talam gravatar imagetalam ( 2017-04-21 15:52:54 -0600 )edit

Yes opencv3.2 is new opencv version (dec-2016) Opencvvision is 3 years old so I think you can use it with https://github.com/opencv/opencv/tree...

LBerger gravatar imageLBerger ( 2017-04-21 16:00:51 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
1

answered 2017-04-21 16:09:21 -0600

talam gravatar image

thank you you were really helpful

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2017-04-21 13:50:47 -0600

Seen: 2,458 times

Last updated: Apr 21 '17