I'm trying to install OpenCV 3.1.0 from source on OSX following this article. Long story short, I'm at the point of creating the make file using the following declarations:
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local
-D PYTHON2_PACKAGES_PATH=~/.virtualenvs/cv/lib/python2.7/site-packages
-D PYTHON2_LIBRARY=/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/bin
-D PYTHON2_INCLUDE_DIR=/usr/local/Frameworks/Python.framework/Headers
-D INSTALL_C_EXAMPLES=OFF -D INSTALL_PYTHON_EXAMPLES=ON
-D BUILD_EXAMPELS=ON
-D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib/modules ..
The resultant build information I get includes this:
-- 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 python2
-- Disabled: world contrib_world
-- Disabled by dependency: -
-- Unavailable: cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev java python3 viz cvv hdf matlab sfm
Most notably: xfeatures2d
I then run make -j4 and then sudo make install to install the compiled OpenCV 3.1.0 package. The output includes:
-- Installing: /usr/local/lib/libopencv_xfeatures2d.3.1.0.dylib
-- Up-to-date: /usr/local/lib/libopencv_xfeatures2d.3.1.dylib
-- Up-to-date: /usr/local/lib/libopencv_xfeatures2d.dylib
-- Up-to-date: /usr/local/include/opencv2/xfeatures2d.hpp
-- Up-to-date: /usr/local/include/opencv2/xfeatures2d/cuda.hpp
-- Up-to-date: /usr/local/include/opencv2/xfeatures2d/nonfree.hpp
Immediately after, I run python for the interpreter, then import cv, cv2.xfeatures2d and get:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'xfeatures2d'
I don't understand why the extra packages added by opencv-contrib aren't being included in the installation. cmake says they're being included, but they aren't.
Recent Questions...
ما را در سایت Recent Questions دنبال میکنید
برچسب:
نویسنده: استخدام کار
بازدید: 227
تاريخ: يکشنبه
19 ارديبهشت
1395 ساعت: 3:55