如何在 OSX 10.5 32 位上安装 OpenCV 2.2 for ActivePython 2.7?
标题就是整个问题。
- 我尝试过使用 --build32 选项进行自制程序
- 我尝试过 macports
- 我尝试过下载源文件并从头开始编译。
以上所有内容都安装完美,没有任何问题。然而,在从各种安装中找到正确的 cv.so 文件并将它们移动到我想要使用 OpenCV 的 Python 版本的正确 /site-packages/ 目录后,并确保它在 PYTHONPATH 中正确无误 - - 我总是收到此错误:
ActivePython 2.7.1.4 (ActiveState Software Inc.) based on
Python 2.7.1 (r271:86832, Feb 7 2011, 11:33:10)
[GCC 4.2.1 (Apple Inc. build 5664)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: dlopen(/usr/local/lib/python2.7/site-packages/cv.so, 2): no suitable image found. Did find:
/usr/local/lib/python2.7/site-packages/cv.so: mach-o, but wrong architecture
同样,这是在我竭尽全力寻找 32 位版本之后发生的。我搜索了 OpenCV 网站,找不到任何 2.2 版本的 32 位特定源文件的链接。当我在从头开始安装期间监视它时,我注意到它在配置、make 和编译期间正确传递了 arch i386 选项(因为它应该检测我的系统体系结构是 32 位)。
我真的很不知所措。有什么想法吗?请记住,我特别尝试让 OpenCV 2.2 版本专门与 Python 的 ActivePython 2.7 版本一起使用。我有 OpenCV 2.1 和 Python 2.6.6 一起使用,但我刚刚更新了我的工作计算机以在 Ubuntu 中使用 OpenCV 2.2 和 ActivePython 2.7,并且我希望能够在该计算机和我的家庭计算机之间顺利共享内容。对于我正在做的事情来说,拥有最新的 OpenCV 非常重要。
好的,我的具体步骤如下:
(1) 将 OpenCV 源代码提取到目录 ~/OpenCV-2.2.0/ (2) 运行cmake,使用gedit添加上面提到的体系结构字符串,然后运行sudo make,然后运行sudo make install。这是后两个步骤的输出:
new-host:OpenCV-2.2.0 ely$ sudo make
-- Extracting svn version, please wait...
-- SVNVERSION:
-- Detected version of GNU GCC: 40 (400)
-- checking for module 'libavcodec'
-- package 'libavcodec' not found
-- checking for module 'libavformat'
-- package 'libavformat' not found
-- checking for module 'libavutil'
-- package 'libavutil' not found
-- checking for module 'libswscale'
-- package 'libswscale' not found
-- checking for module 'libdc1394-2'
-- package 'libdc1394-2' not found
-- checking for module 'libdc1394'
-- package 'libdc1394' not found
-- Use INCLUDE: /Users/ely/Library/Python/2.7/lib/python/site-packages/numpy/core/include
-- IPP detected:
-- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE)
-- Parsing 'cvconfig.h.cmake'
--
-- General configuration for opencv 2.2.0 =====================================
--
-- Built as dynamic libs?: ON
-- Compiler:
-- C++ flags (Release): -Wall -pthread -O3 -DNDEBUG -fomit-frame-pointer -O3 -ffast-math -msse -msse2 -DNDEBUG
-- C++ flags (Debug): -Wall -pthread -g -O0 -ggdb3 -DDEBUG -D_DEBUG
-- Linker flags (Release):
-- Linker flags (Debug):
--
-- GUI:
-- Cocoa: 1
--
-- Image I/O:
-- JPEG: build
-- PNG: build
-- TIFF: build
-- JPEG 2000: build
-- OpenEXR: NO
--
-- Video I/O: QTKit
--
-- Interfaces:
-- Python: ON
-- Python interpreter: /usr/local/bin/python2.7
-- Python numpy: YES
-- Use IPP: NO
-- Use TBB: NO
-- Use Cuda: No
-- Use Eigen2: NO
--
-- Documentation:
-- Build PDF NO
-- Doxygen HTMLs NO
--
-- Install path: /usr/local
--
-- cvconfig.h is in: /Users/ely/OpenCV-2.2.0
-- -----------------------------------------------------------------
--
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/ely/OpenCV-2.2.0
[ 4%] Built target libtiff
[ 6%] Built target zlib
Scanning dependencies of target opencv_core_pch_dephelp
[ 6%] Building CXX object modules/core/CMakeFiles/opencv_core_pch_dephelp.dir/opencv_core_pch_dephelp.o
Linking CXX static library ../../lib/libopencv_core_pch_dephelp.a
[ 6%] Built target opencv_core_pch_dephelp
[ 6%] Generating precomp.hpp.gch/opencv_core_Release.gch
[ 6%] Built target pch_Generate_opencv_core
[ 40%] Built target opencv_lapack
[ 42%] Built target opencv_core
Scanning dependencies of target opencv_imgproc_pch_dephelp
[ 43%] Building CXX object modules/imgproc/CMakeFiles/opencv_imgproc_pch_dephelp.dir/opencv_imgproc_pch_dephelp.o
Linking CXX static library ../../lib/libopencv_imgproc_pch_dephelp.a
[ 43%] Built target opencv_imgproc_pch_dephelp
[ 43%] Generating precomp.hpp.gch/opencv_imgproc_Release.gch
[ 43%] Built target pch_Generate_opencv_imgproc
[ 47%] Built target opencv_imgproc
Scanning dependencies of target opencv_highgui_pch_dephelp
[ 48%] Building CXX object modules/highgui/CMakeFiles/opencv_highgui_pch_dephelp.dir/opencv_highgui_pch_dephelp.o
Linking CXX static library ../../lib/libopencv_highgui_pch_dephelp.a
[ 48%] Built target opencv_highgui_pch_dephelp
[ 48%] Generating precomp.hpp.gch/opencv_highgui_Release.gch
[ 48%] Built target pch_Generate_opencv_highgui
[ 52%] Built target libjasper
[ 57%] Built target libjpeg
[ 59%] Built target libpng
[ 61%] Built target opencv_highgui
Scanning dependencies of target opencv_calib3d_pch_dephelp
[ 61%] Building CXX object modules/calib3d/CMakeFiles/opencv_calib3d_pch_dephelp.dir/opencv_calib3d_pch_dephelp.o
Linking CXX static library ../../lib/libopencv_calib3d_pch_dephelp.a
[ 61%] Built target opencv_calib3d_pch_dephelp
[ 61%] Generating precomp.hpp.gch/opencv_calib3d_Release.gch
[ 61%] Built target pch_Generate_opencv_calib3d
[ 62%] Built target opencv_calib3d
Scanning dependencies of target opencv_features2d_pch_dephelp
[ 62%] Building CXX object modules/features2d/CMakeFiles/opencv_features2d_pch_dephelp.dir/opencv_features2d_pch_dephelp.o
Linking CXX static library ../../lib/libopencv_features2d_pch_dephelp.a
[ 62%] Built target opencv_features2d_pch_dephelp
[ 62%] Generating precomp.hpp.gch/opencv_features2d_Release.gch
[ 63%] Built target pch_Generate_opencv_features2d
Scanning dependencies of target opencv_flann_pch_dephelp
[ 63%] Building CXX object modules/flann/CMakeFiles/opencv_flann_pch_dephelp.dir/opencv_flann_pch_dephelp.o
Linking CXX static library ../../lib/libopencv_flann_pch_dephelp.a
[ 63%] Built target opencv_flann_pch_dephelp
[ 63%] Generating precomp.hpp.gch/opencv_flann_Release.gch
[ 63%] Built target pch_Generate_opencv_flann
[ 63%] Built target opencv_flann
[ 65%] Built target opencv_features2d
Scanning dependencies of target opencv_video_pch_dephelp
[ 65%] Building CXX object modules/video/CMakeFiles/opencv_video_pch_dephelp.dir/opencv_video_pch_dephelp.o
Linking CXX static library ../../lib/libopencv_video_pch_dephelp.a
[ 65%] Built target opencv_video_pch_dephelp
[ 65%] Generating precomp.hpp.gch/opencv_video_Release.gch
[ 65%] Built target pch_Generate_opencv_video
[ 67%] Built target opencv_video
Scanning dependencies of target opencv_legacy_pch_dephelp
[ 67%] Building CXX object modules/legacy/CMakeFiles/opencv_legacy_pch_dephelp.dir/opencv_legacy_pch_dephelp.o
Linking CXX static library ../../lib/libopencv_legacy_pch_dephelp.a
[ 67%] Built target opencv_legacy_pch_dephelp
[ 67%] Generating precomp.hpp.gch/opencv_legacy_Release.gch
[ 68%] Built target pch_Generate_opencv_legacy
[ 76%] Built target opencv_legacy
Scanning dependencies of target opencv_contrib_pch_dephelp
[ 77%] Building CXX object modules/contrib/CMakeFiles/opencv_contrib_pch_dephelp.dir/opencv_contrib_pch_dephelp.o
Linking CXX static library ../../lib/libopencv_contrib_pch_dephelp.a
[ 77%] Built target opencv_contrib_pch_dephelp
[ 77%] Generating precomp.hpp.gch/opencv_contrib_Release.gch
[ 77%] Built target pch_Generate_opencv_contrib
Scanning dependencies of target opencv_ml_pch_dephelp
[ 77%] Building CXX object modules/ml/CMakeFiles/opencv_ml_pch_dephelp.dir/opencv_ml_pch_dephelp.o
Linking CXX static library ../../lib/libopencv_ml_pch_dephelp.a
[ 77%] Built target opencv_ml_pch_dephelp
[ 77%] Generating precomp.hpp.gch/opencv_ml_Release.gch
[ 77%] Built target pch_Generate_opencv_ml
[ 79%] Built target opencv_ml
Scanning dependencies of target opencv_objdetect_pch_dephelp
[ 79%] Building CXX object modules/objdetect/CMakeFiles/opencv_objdetect_pch_dephelp.dir/opencv_objdetect_pch_dephelp.o
Linking CXX static library ../../lib/libopencv_objdetect_pch_dephelp.a
[ 79%] Built target opencv_objdetect_pch_dephelp
[ 79%] Generating precomp.hpp.gch/opencv_objdetect_Release.gch
[ 79%] Built target pch_Generate_opencv_objdetect
[ 80%] Built target opencv_objdetect
[ 81%] Built target opencv_contrib
[ 81%] Built target opencv_python
[ 81%] Built target opencv_haartraining_engine
[ 81%] Built target opencv_createsamples
[ 81%] Built target opencv_haartraining
[ 82%] Built target opencv_performance
[ 83%] Built target opencv_traincascade
Scanning dependencies of target opencv_gpu_pch_dephelp
[ 83%] Building CXX object modules/gpu/CMakeFiles/opencv_gpu_pch_dephelp.dir/opencv_gpu_pch_dephelp.o
Linking CXX static library ../../lib/libopencv_gpu_pch_dephelp.a
[ 83%] Built target opencv_gpu_pch_dephelp
[ 83%] Generating precomp.hpp.gch/opencv_gpu_Release.gch
[ 83%] Built target pch_Generate_opencv_gpu
[ 86%] Built target opencv_gpu
[ 86%] Built target opencv_ts
Scanning dependencies of target opencv_test_pch_dephelp
[ 86%] Building CXX object tests/cv/CMakeFiles/opencv_test_pch_dephelp.dir/opencv_test_pch_dephelp.o
Linking CXX static library ../../lib/libopencv_test_pch_dephelp.a
[ 86%] Built target opencv_test_pch_dephelp
[ 86%] Generating cvtest.h.gch/opencv_test_Release.gch
[ 86%] Built target pch_Generate_opencv_test
[ 94%] Built target opencv_test
Scanning dependencies of target opencv_test_core_pch_dephelp
[ 94%] Building CXX object tests/cxcore/CMakeFiles/opencv_test_core_pch_dephelp.dir/opencv_test_core_pch_dephelp.o
Linking CXX static library ../../lib/libopencv_test_core_pch_dephelp.a
[ 94%] Built target opencv_test_core_pch_dephelp
[ 94%] Generating cxcoretest.h.gch/opencv_test_core_Release.gch
[ 95%] Built target pch_Generate_opencv_test_core
[ 97%] Built target opencv_test_core
[ 98%] Built target opencv_test_ml
[100%] Built target opencv_test_gpu
new-host:OpenCV-2.2.0 ely$ sudo make install
[ 4%] Built target libtiff
[ 6%] Built target zlib
[ 6%] Built target opencv_core_pch_dephelp
[ 6%] Built target pch_Generate_opencv_core
[ 40%] Built target opencv_lapack
[ 42%] Built target opencv_core
[ 43%] Built target opencv_imgproc_pch_dephelp
[ 43%] Built target pch_Generate_opencv_imgproc
[ 47%] Built target opencv_imgproc
[ 48%] Built target opencv_highgui_pch_dephelp
[ 48%] Built target pch_Generate_opencv_highgui
[ 52%] Built target libjasper
[ 57%] Built target libjpeg
[ 59%] Built target libpng
[ 61%] Built target opencv_highgui
[ 61%] Built target opencv_calib3d_pch_dephelp
[ 61%] Built target pch_Generate_opencv_calib3d
[ 62%] Built target opencv_calib3d
[ 62%] Built target opencv_features2d_pch_dephelp
[ 63%] Built target pch_Generate_opencv_features2d
[ 63%] Built target opencv_flann_pch_dephelp
[ 63%] Built target pch_Generate_opencv_flann
[ 63%] Built target opencv_flann
[ 65%] Built target opencv_features2d
[ 65%] Built target opencv_video_pch_dephelp
[ 65%] Built target pch_Generate_opencv_video
[ 67%] Built target opencv_video
[ 67%] Built target opencv_legacy_pch_dephelp
[ 68%] Built target pch_Generate_opencv_legacy
[ 76%] Built target opencv_legacy
[ 77%] Built target opencv_contrib_pch_dephelp
[ 77%] Built target pch_Generate_opencv_contrib
[ 77%] Built target opencv_ml_pch_dephelp
[ 77%] Built target pch_Generate_opencv_ml
[ 79%] Built target opencv_ml
[ 79%] Built target opencv_objdetect_pch_dephelp
[ 79%] Built target pch_Generate_opencv_objdetect
[ 80%] Built target opencv_objdetect
[ 81%] Built target opencv_contrib
[ 81%] Built target opencv_python
[ 81%] Built target opencv_haartraining_engine
[ 81%] Built target opencv_createsamples
[ 81%] Built target opencv_haartraining
[ 82%] Built target opencv_performance
[ 83%] Built target opencv_traincascade
[ 83%] Built target opencv_gpu_pch_dephelp
[ 83%] Built target pch_Generate_opencv_gpu
[ 86%] Built target opencv_gpu
[ 86%] Built target opencv_ts
[ 86%] Built target opencv_test_pch_dephelp
[ 86%] Built target pch_Generate_opencv_test
[ 94%] Built target opencv_test
[ 94%] Built target opencv_test_core_pch_dephelp
[ 95%] Built target pch_Generate_opencv_test_core
[ 97%] Built target opencv_test_core
[ 98%] Built target opencv_test_ml
[100%] Built target opencv_test_gpu
Install the project...
-- Install configuration: "Release"
-- Installing: /usr/local/share/opencv/OpenCVConfig.cmake
-- Installing: /usr/local/lib/pkgconfig/opencv.pc
-- Installing: /usr/local/include/opencv/cv.h
-- Installing: /usr/local/include/opencv/cv.hpp
-- Installing: /usr/local/include/opencv/cvaux.h
-- Installing: /usr/local/include/opencv/cvaux.hpp
-- Installing: /usr/local/include/opencv/cvwimage.h
-- Installing: /usr/local/include/opencv/cxcore.h
-- Installing: /usr/local/include/opencv/cxcore.hpp
-- Installing: /usr/local/include/opencv/cxeigen.hpp
-- Installing: /usr/local/include/opencv/cxmisc.h
-- Installing: /usr/local/include/opencv/highgui.h
-- Installing: /usr/local/include/opencv/ml.h
-- Installing: /usr/local/include/opencv2/opencv.hpp
-- Installing: /usr/local/lib/libopencv_calib3d.2.2.0.dylib
-- Up-to-date: /usr/local/lib/libopencv_calib3d.2.2.dylib
-- Up-to-date: /usr/local/lib/libopencv_calib3d.dylib
-- Installing: /usr/local/include/opencv2/calib3d/calib3d.hpp
-- Installing: /usr/local/lib/libopencv_core.2.2.0.dylib
-- Up-to-date: /usr/local/lib/libopencv_core.2.2.dylib
-- Up-to-date: /usr/local/lib/libopencv_core.dylib
-- Installing: /usr/local/include/opencv2/core/core.hpp
-- Installing: /usr/local/include/opencv2/core/core_c.h
-- Installing: /usr/local/include/opencv2/core/eigen.hpp
-- Installing: /usr/local/include/opencv2/core/internal.hpp
-- Installing: /usr/local/include/opencv2/core/mat.hpp
-- Installing: /usr/local/include/opencv2/core/operations.hpp
-- Installing: /usr/local/include/opencv2/core/types_c.h
-- Installing: /usr/local/include/opencv2/core/version.hpp
-- Installing: /usr/local/include/opencv2/core/wimage.hpp
-- Installing: /usr/local/lib/libopencv_features2d.2.2.0.dylib
-- Up-to-date: /usr/local/lib/libopencv_features2d.2.2.dylib
-- Up-to-date: /usr/local/lib/libopencv_features2d.dylib
-- Installing: /usr/local/include/opencv2/features2d/features2d.hpp
-- Installing: /usr/local/lib/libopencv_flann.2.2.0.dylib
-- Up-to-date: /usr/local/lib/libopencv_flann.2.2.dylib
-- Up-to-date: /usr/local/lib/libopencv_flann.dylib
-- Installing: /usr/local/include/opencv2/flann/all_indices.h
-- Installing: /usr/local/include/opencv2/flann/allocator.h
-- Installing: /usr/local/include/opencv2/flann/autotuned_index.h
-- Installing: /usr/local/include/opencv2/flann/composite_index.h
-- Installing: /usr/local/include/opencv2/flann/dist.h
-- Installing: /usr/local/include/opencv2/flann/flann.hpp
-- Installing: /usr/local/include/opencv2/flann/flann_base.hpp
-- Installing: /usr/local/include/opencv2/flann/general.h
-- Installing: /usr/local/include/opencv2/flann/ground_truth.h
-- Installing: /usr/local/include/opencv2/flann/hdf5.h
-- Installing: /usr/local/include/opencv2/flann/heap.h
-- Installing: /usr/local/include/opencv2/flann/index_testing.h
-- Installing: /usr/local/include/opencv2/flann/kdtree_index.h
-- Installing: /usr/local/include/opencv2/flann/kmeans_index.h
-- Installing: /usr/local/include/opencv2/flann/linear_index.h
-- Installing: /usr/local/include/opencv2/flann/logger.h
-- Installing: /usr/local/include/opencv2/flann/matrix.h
-- Installing: /usr/local/include/opencv2/flann/nn_index.h
-- Installing: /usr/local/include/opencv2/flann/object_factory.h
-- Installing: /usr/local/include/opencv2/flann/random.h
-- Installing: /usr/local/include/opencv2/flann/result_set.h
-- Installing: /usr/local/include/opencv2/flann/sampling.h
-- Installing: /usr/local/include/opencv2/flann/saving.h
-- Installing: /usr/local/include/opencv2/flann/simplex_downhill.h
-- Installing: /usr/local/include/opencv2/flann/timer.h
-- Installing: /usr/local/lib/libopencv_highgui.2.2.0.dylib
-- Up-to-date: /usr/local/lib/libopencv_highgui.2.2.dylib
-- Up-to-date: /usr/local/lib/libopencv_highgui.dylib
-- Installing: /usr/local/include/opencv2/highgui/highgui_c.h
-- Installing: /usr/local/include/opencv2/highgui/highgui.hpp
-- Installing: /usr/local/lib/libopencv_imgproc.2.2.0.dylib
-- Up-to-date: /usr/local/lib/libopencv_imgproc.2.2.dylib
-- Up-to-date: /usr/local/lib/libopencv_imgproc.dylib
-- Installing: /usr/local/include/opencv2/imgproc/imgproc.hpp
-- Installing: /usr/local/include/opencv2/imgproc/imgproc_c.h
-- Installing: /usr/local/include/opencv2/imgproc/types_c.h
-- Installing: /usr/local/lib/libopencv_legacy.2.2.0.dylib
-- Up-to-date: /usr/local/lib/libopencv_legacy.2.2.dylib
-- Up-to-date: /usr/local/lib/libopencv_legacy.dylib
-- Installing: /usr/local/include/opencv2/legacy/blobtrack.hpp
-- Installing: /usr/local/include/opencv2/legacy/compat.hpp
-- Installing: /usr/local/include/opencv2/legacy/legacy.hpp
-- Installing: /usr/local/include/opencv2/legacy/streams.hpp
-- Installing: /usr/local/lib/libopencv_contrib.2.2.0.dylib
-- Up-to-date: /usr/local/lib/libopencv_contrib.2.2.dylib
-- Up-to-date: /usr/local/lib/libopencv_contrib.dylib
-- Installing: /usr/local/include/opencv2/contrib/contrib.hpp
-- Installing: /usr/local/lib/libopencv_ml.2.2.0.dylib
-- Up-to-date: /usr/local/lib/libopencv_ml.2.2.dylib
-- Up-to-date: /usr/local/lib/libopencv_ml.dylib
-- Installing: /usr/local/include/opencv2/ml/ml.hpp
-- Installing: /usr/local/lib/libopencv_objdetect.2.2.0.dylib
-- Up-to-date: /usr/local/lib/libopencv_objdetect.2.2.dylib
-- Up-to-date: /usr/local/lib/libopencv_objdetect.dylib
-- Installing: /usr/local/include/opencv2/objdetect/objdetect.hpp
-- Installing: /usr/local/lib/python2.7/site-packages/cv.so
-- Installing: /usr/local/lib/libopencv_video.2.2.0.dylib
-- Up-to-date: /usr/local/lib/libopencv_video.2.2.dylib
-- Up-to-date: /usr/local/lib/libopencv_video.dylib
-- Installing: /usr/local/include/opencv2/video/background_segm.hpp
-- Installing: /usr/local/include/opencv2/video/tracking.hpp
-- Installing: /usr/local/bin/opencv_haartraining
-- Installing: /usr/local/bin/opencv_createsamples
-- Installing: /usr/local/bin/opencv_performance
-- Installing: /usr/local/bin/opencv_traincascade
-- Installing: /usr/local/lib/libopencv_gpu.2.2.0.dylib
-- Up-to-date: /usr/local/lib/libopencv_gpu.2.2.dylib
-- Up-to-date: /usr/local/lib/libopencv_gpu.dylib
-- Installing: /usr/local/include/opencv2/gpu/devmem2d.hpp
-- Installing: /usr/local/include/opencv2/gpu/gpu.hpp
-- Installing: /usr/local/include/opencv2/gpu/matrix_operations.hpp
-- Installing: /usr/local/include/opencv2/gpu/stream_accessor.hpp
-- Installing: /usr/local/share/opencv/doc/haartraining.htm
-- Installing: /usr/local/share/opencv/doc/CMakeLists.txt
-- Installing: /usr/local/share/opencv/doc/license.txt
-- Installing: /usr/local/share/opencv/doc/packaging.txt
-- Installing: /usr/local/share/opencv/doc/README.txt
-- Installing: /usr/local/share/opencv/doc/opencv.jpg
-- Installing: /usr/local/share/opencv/doc/opencv-logo.png
-- Installing: /usr/local/share/opencv/doc/opencv-logo2.png
-- Installing: /usr/local/share/opencv/doc/opencv.pdf
-- Installing: /usr/local/share/opencv/doc/opencv_cheatsheet.pdf
-- Installing: /usr/local/share/opencv/doc/pattern.pdf
-- Installing: /usr/local/share/opencv/doc/papers/algo_tracking.pdf
-- Installing: /usr/local/share/opencv/doc/papers/camshift.pdf
-- Installing: /usr/local/share/opencv/doc/papers/avbpa99.ps
-- Installing: /usr/local/share/opencv/doc/vidsurv/Blob_Tracking_Modules.doc
-- Installing: /usr/local/share/opencv/doc/vidsurv/Blob_Tracking_Tests.doc
-- Installing: /usr/local/share/opencv/doc/vidsurv/TestSeq.doc
-- Installing: /usr/local/share/opencv/haarcascades/haarcascade_eye.xml
-- Installing: /usr/local/share/opencv/haarcascades/haarcascade_eye_tree_eyeglasses.xml
-- Installing: /usr/local/share/opencv/haarcascades/haarcascade_frontalface_alt.xml
-- Installing: /usr/local/share/opencv/haarcascades/haarcascade_frontalface_alt2.xml
-- Installing: /usr/local/share/opencv/haarcascades/haarcascade_frontalface_alt_tree.xml
-- Installing: /usr/local/share/opencv/haarcascades/haarcascade_frontalface_default.xml
-- Installing: /usr/local/share/opencv/haarcascades/haarcascade_fullbody.xml
-- Installing: /usr/local/share/opencv/haarcascades/haarcascade_lefteye_2splits.xml
-- Installing: /usr/local/share/opencv/haarcascades/haarcascade_lowerbody.xml
-- Installing: /usr/local/share/opencv/haarcascades/haarcascade_mcs_eyepair_big.xml
-- Installing: /usr/local/share/opencv/haarcascades/haarcascade_mcs_eyepair_small.xml
-- Installing: /usr/local/share/opencv/haarcascades/haarcascade_mcs_lefteye.xml
-- Installing: /usr/local/share/opencv/haarcascades/haarcascade_mcs_mouth.xml
-- Installing: /usr/local/share/opencv/haarcascades/haarcascade_mcs_nose.xml
-- Installing: /usr/local/share/opencv/haarcascades/haarcascade_mcs_righteye.xml
-- Installing: /usr/local/share/opencv/haarcascades/haarcascade_mcs_upperbody.xml
-- Installing: /usr/local/share/opencv/haarcascades/haarcascade_profileface.xml
-- Installing: /usr/local/share/opencv/haarcascades/haarcascade_righteye_2splits.xml
-- Installing: /usr/local/share/opencv/haarcascades/haarcascade_upperbody.xml
-- Installing: /usr/local/share/opencv/lbpcascades/lbpcascade_frontalface.xml
new-host:OpenCV-2.2.0 ely$ python
ActivePython 2.7.1.4 (ActiveState Software Inc.) based on
Python 2.7.1 (r271:86832, Feb 7 2011, 11:33:10)
[GCC 4.2.1 (Apple Inc. build 5664)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: dlopen(/usr/local/lib/python2.7/site-packages/cv.so, 2): no suitable image found. Did find:
/usr/local/lib/python2.7/site-packages/cv.so: mach-o, but wrong architecture
>>> exit()
为了确定,根据安装过程中找到的 Python 路径,我尝试了:
new-host:OpenCV-2.2.0 ely$ /usr/local/bin/python2.7
ActivePython 2.7.1.4 (ActiveState Software Inc.) based on
Python 2.7.1 (r271:86832, Feb 7 2011, 11:33:10)
[GCC 4.2.1 (Apple Inc. build 5664)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: dlopen(/usr/local/lib/python2.7/site-packages/cv.so, 2): no suitable image found. Did find:
/usr/local/lib/python2.7/site-packages/cv.so: mach-o, but wrong architecture
似乎无论我做什么,我都会遇到此架构错误。我已经直接安装了 OpenCV,没有任何问题,无论 CMakeCache.txt 中是否有此架构字符串说明符,两种方法都会导致相同的错误。
我很感谢您的帮助,还有其他想法吗?
The title is the whole question.
- I have tried homebrew with the --build32 option
- I have tried macports
- I have tried downloading the source file and compiling from scratch.
All the above install perfectly with no issues. However -- after tracking down the correct cv.so files from the various installations and moving them to the correct /site-packages/ directory for the version of Python I want to use OpenCV with, and ensuring that it is correctly in the PYTHONPATH -- I perpetually get this error:
ActivePython 2.7.1.4 (ActiveState Software Inc.) based on
Python 2.7.1 (r271:86832, Feb 7 2011, 11:33:10)
[GCC 4.2.1 (Apple Inc. build 5664)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: dlopen(/usr/local/lib/python2.7/site-packages/cv.so, 2): no suitable image found. Did find:
/usr/local/lib/python2.7/site-packages/cv.so: mach-o, but wrong architecture
Again, this is after I have exhaustively tried to find a 32-bit version. I searched the OpenCV site and could not find any links to a 32-bit specific source file of version 2.2. When I monitored it during the from-scratch installation, I noted that it was correctly passing around the arch i386 options during configure and make and compiling (as it should since it should be detecting that my system architecture is 32-bit).
I'm really at a loss. Any ideas? Bear in mind that I am specifically trying to get version 2.2 of OpenCV to work specifically with ActivePython version 2.7 of Python. I have OpenCV 2.1 working with Python 2.6.6, but I just updated my work computer to use OpenCV 2.2 with ActivePython 2.7 in Ubuntu and I want to be able to share things smoothly between that computer and my home computer. For the stuff I am doing, having the newest OpenCV is significant.
Okay, so here are my exact steps:
(1) Extract the OpenCV source to the directory ~/OpenCV-2.2.0/
(2) Run cmake, use gedit to add the architectures string mentioned above, then run sudo make followed by sudo make install. Here's the output of the later two steps:
new-host:OpenCV-2.2.0 ely$ sudo make
-- Extracting svn version, please wait...
-- SVNVERSION:
-- Detected version of GNU GCC: 40 (400)
-- checking for module 'libavcodec'
-- package 'libavcodec' not found
-- checking for module 'libavformat'
-- package 'libavformat' not found
-- checking for module 'libavutil'
-- package 'libavutil' not found
-- checking for module 'libswscale'
-- package 'libswscale' not found
-- checking for module 'libdc1394-2'
-- package 'libdc1394-2' not found
-- checking for module 'libdc1394'
-- package 'libdc1394' not found
-- Use INCLUDE: /Users/ely/Library/Python/2.7/lib/python/site-packages/numpy/core/include
-- IPP detected:
-- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE)
-- Parsing 'cvconfig.h.cmake'
--
-- General configuration for opencv 2.2.0 =====================================
--
-- Built as dynamic libs?: ON
-- Compiler:
-- C++ flags (Release): -Wall -pthread -O3 -DNDEBUG -fomit-frame-pointer -O3 -ffast-math -msse -msse2 -DNDEBUG
-- C++ flags (Debug): -Wall -pthread -g -O0 -ggdb3 -DDEBUG -D_DEBUG
-- Linker flags (Release):
-- Linker flags (Debug):
--
-- GUI:
-- Cocoa: 1
--
-- Image I/O:
-- JPEG: build
-- PNG: build
-- TIFF: build
-- JPEG 2000: build
-- OpenEXR: NO
--
-- Video I/O: QTKit
--
-- Interfaces:
-- Python: ON
-- Python interpreter: /usr/local/bin/python2.7
-- Python numpy: YES
-- Use IPP: NO
-- Use TBB: NO
-- Use Cuda: No
-- Use Eigen2: NO
--
-- Documentation:
-- Build PDF NO
-- Doxygen HTMLs NO
--
-- Install path: /usr/local
--
-- cvconfig.h is in: /Users/ely/OpenCV-2.2.0
-- -----------------------------------------------------------------
--
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/ely/OpenCV-2.2.0
[ 4%] Built target libtiff
[ 6%] Built target zlib
Scanning dependencies of target opencv_core_pch_dephelp
[ 6%] Building CXX object modules/core/CMakeFiles/opencv_core_pch_dephelp.dir/opencv_core_pch_dephelp.o
Linking CXX static library ../../lib/libopencv_core_pch_dephelp.a
[ 6%] Built target opencv_core_pch_dephelp
[ 6%] Generating precomp.hpp.gch/opencv_core_Release.gch
[ 6%] Built target pch_Generate_opencv_core
[ 40%] Built target opencv_lapack
[ 42%] Built target opencv_core
Scanning dependencies of target opencv_imgproc_pch_dephelp
[ 43%] Building CXX object modules/imgproc/CMakeFiles/opencv_imgproc_pch_dephelp.dir/opencv_imgproc_pch_dephelp.o
Linking CXX static library ../../lib/libopencv_imgproc_pch_dephelp.a
[ 43%] Built target opencv_imgproc_pch_dephelp
[ 43%] Generating precomp.hpp.gch/opencv_imgproc_Release.gch
[ 43%] Built target pch_Generate_opencv_imgproc
[ 47%] Built target opencv_imgproc
Scanning dependencies of target opencv_highgui_pch_dephelp
[ 48%] Building CXX object modules/highgui/CMakeFiles/opencv_highgui_pch_dephelp.dir/opencv_highgui_pch_dephelp.o
Linking CXX static library ../../lib/libopencv_highgui_pch_dephelp.a
[ 48%] Built target opencv_highgui_pch_dephelp
[ 48%] Generating precomp.hpp.gch/opencv_highgui_Release.gch
[ 48%] Built target pch_Generate_opencv_highgui
[ 52%] Built target libjasper
[ 57%] Built target libjpeg
[ 59%] Built target libpng
[ 61%] Built target opencv_highgui
Scanning dependencies of target opencv_calib3d_pch_dephelp
[ 61%] Building CXX object modules/calib3d/CMakeFiles/opencv_calib3d_pch_dephelp.dir/opencv_calib3d_pch_dephelp.o
Linking CXX static library ../../lib/libopencv_calib3d_pch_dephelp.a
[ 61%] Built target opencv_calib3d_pch_dephelp
[ 61%] Generating precomp.hpp.gch/opencv_calib3d_Release.gch
[ 61%] Built target pch_Generate_opencv_calib3d
[ 62%] Built target opencv_calib3d
Scanning dependencies of target opencv_features2d_pch_dephelp
[ 62%] Building CXX object modules/features2d/CMakeFiles/opencv_features2d_pch_dephelp.dir/opencv_features2d_pch_dephelp.o
Linking CXX static library ../../lib/libopencv_features2d_pch_dephelp.a
[ 62%] Built target opencv_features2d_pch_dephelp
[ 62%] Generating precomp.hpp.gch/opencv_features2d_Release.gch
[ 63%] Built target pch_Generate_opencv_features2d
Scanning dependencies of target opencv_flann_pch_dephelp
[ 63%] Building CXX object modules/flann/CMakeFiles/opencv_flann_pch_dephelp.dir/opencv_flann_pch_dephelp.o
Linking CXX static library ../../lib/libopencv_flann_pch_dephelp.a
[ 63%] Built target opencv_flann_pch_dephelp
[ 63%] Generating precomp.hpp.gch/opencv_flann_Release.gch
[ 63%] Built target pch_Generate_opencv_flann
[ 63%] Built target opencv_flann
[ 65%] Built target opencv_features2d
Scanning dependencies of target opencv_video_pch_dephelp
[ 65%] Building CXX object modules/video/CMakeFiles/opencv_video_pch_dephelp.dir/opencv_video_pch_dephelp.o
Linking CXX static library ../../lib/libopencv_video_pch_dephelp.a
[ 65%] Built target opencv_video_pch_dephelp
[ 65%] Generating precomp.hpp.gch/opencv_video_Release.gch
[ 65%] Built target pch_Generate_opencv_video
[ 67%] Built target opencv_video
Scanning dependencies of target opencv_legacy_pch_dephelp
[ 67%] Building CXX object modules/legacy/CMakeFiles/opencv_legacy_pch_dephelp.dir/opencv_legacy_pch_dephelp.o
Linking CXX static library ../../lib/libopencv_legacy_pch_dephelp.a
[ 67%] Built target opencv_legacy_pch_dephelp
[ 67%] Generating precomp.hpp.gch/opencv_legacy_Release.gch
[ 68%] Built target pch_Generate_opencv_legacy
[ 76%] Built target opencv_legacy
Scanning dependencies of target opencv_contrib_pch_dephelp
[ 77%] Building CXX object modules/contrib/CMakeFiles/opencv_contrib_pch_dephelp.dir/opencv_contrib_pch_dephelp.o
Linking CXX static library ../../lib/libopencv_contrib_pch_dephelp.a
[ 77%] Built target opencv_contrib_pch_dephelp
[ 77%] Generating precomp.hpp.gch/opencv_contrib_Release.gch
[ 77%] Built target pch_Generate_opencv_contrib
Scanning dependencies of target opencv_ml_pch_dephelp
[ 77%] Building CXX object modules/ml/CMakeFiles/opencv_ml_pch_dephelp.dir/opencv_ml_pch_dephelp.o
Linking CXX static library ../../lib/libopencv_ml_pch_dephelp.a
[ 77%] Built target opencv_ml_pch_dephelp
[ 77%] Generating precomp.hpp.gch/opencv_ml_Release.gch
[ 77%] Built target pch_Generate_opencv_ml
[ 79%] Built target opencv_ml
Scanning dependencies of target opencv_objdetect_pch_dephelp
[ 79%] Building CXX object modules/objdetect/CMakeFiles/opencv_objdetect_pch_dephelp.dir/opencv_objdetect_pch_dephelp.o
Linking CXX static library ../../lib/libopencv_objdetect_pch_dephelp.a
[ 79%] Built target opencv_objdetect_pch_dephelp
[ 79%] Generating precomp.hpp.gch/opencv_objdetect_Release.gch
[ 79%] Built target pch_Generate_opencv_objdetect
[ 80%] Built target opencv_objdetect
[ 81%] Built target opencv_contrib
[ 81%] Built target opencv_python
[ 81%] Built target opencv_haartraining_engine
[ 81%] Built target opencv_createsamples
[ 81%] Built target opencv_haartraining
[ 82%] Built target opencv_performance
[ 83%] Built target opencv_traincascade
Scanning dependencies of target opencv_gpu_pch_dephelp
[ 83%] Building CXX object modules/gpu/CMakeFiles/opencv_gpu_pch_dephelp.dir/opencv_gpu_pch_dephelp.o
Linking CXX static library ../../lib/libopencv_gpu_pch_dephelp.a
[ 83%] Built target opencv_gpu_pch_dephelp
[ 83%] Generating precomp.hpp.gch/opencv_gpu_Release.gch
[ 83%] Built target pch_Generate_opencv_gpu
[ 86%] Built target opencv_gpu
[ 86%] Built target opencv_ts
Scanning dependencies of target opencv_test_pch_dephelp
[ 86%] Building CXX object tests/cv/CMakeFiles/opencv_test_pch_dephelp.dir/opencv_test_pch_dephelp.o
Linking CXX static library ../../lib/libopencv_test_pch_dephelp.a
[ 86%] Built target opencv_test_pch_dephelp
[ 86%] Generating cvtest.h.gch/opencv_test_Release.gch
[ 86%] Built target pch_Generate_opencv_test
[ 94%] Built target opencv_test
Scanning dependencies of target opencv_test_core_pch_dephelp
[ 94%] Building CXX object tests/cxcore/CMakeFiles/opencv_test_core_pch_dephelp.dir/opencv_test_core_pch_dephelp.o
Linking CXX static library ../../lib/libopencv_test_core_pch_dephelp.a
[ 94%] Built target opencv_test_core_pch_dephelp
[ 94%] Generating cxcoretest.h.gch/opencv_test_core_Release.gch
[ 95%] Built target pch_Generate_opencv_test_core
[ 97%] Built target opencv_test_core
[ 98%] Built target opencv_test_ml
[100%] Built target opencv_test_gpu
new-host:OpenCV-2.2.0 ely$ sudo make install
[ 4%] Built target libtiff
[ 6%] Built target zlib
[ 6%] Built target opencv_core_pch_dephelp
[ 6%] Built target pch_Generate_opencv_core
[ 40%] Built target opencv_lapack
[ 42%] Built target opencv_core
[ 43%] Built target opencv_imgproc_pch_dephelp
[ 43%] Built target pch_Generate_opencv_imgproc
[ 47%] Built target opencv_imgproc
[ 48%] Built target opencv_highgui_pch_dephelp
[ 48%] Built target pch_Generate_opencv_highgui
[ 52%] Built target libjasper
[ 57%] Built target libjpeg
[ 59%] Built target libpng
[ 61%] Built target opencv_highgui
[ 61%] Built target opencv_calib3d_pch_dephelp
[ 61%] Built target pch_Generate_opencv_calib3d
[ 62%] Built target opencv_calib3d
[ 62%] Built target opencv_features2d_pch_dephelp
[ 63%] Built target pch_Generate_opencv_features2d
[ 63%] Built target opencv_flann_pch_dephelp
[ 63%] Built target pch_Generate_opencv_flann
[ 63%] Built target opencv_flann
[ 65%] Built target opencv_features2d
[ 65%] Built target opencv_video_pch_dephelp
[ 65%] Built target pch_Generate_opencv_video
[ 67%] Built target opencv_video
[ 67%] Built target opencv_legacy_pch_dephelp
[ 68%] Built target pch_Generate_opencv_legacy
[ 76%] Built target opencv_legacy
[ 77%] Built target opencv_contrib_pch_dephelp
[ 77%] Built target pch_Generate_opencv_contrib
[ 77%] Built target opencv_ml_pch_dephelp
[ 77%] Built target pch_Generate_opencv_ml
[ 79%] Built target opencv_ml
[ 79%] Built target opencv_objdetect_pch_dephelp
[ 79%] Built target pch_Generate_opencv_objdetect
[ 80%] Built target opencv_objdetect
[ 81%] Built target opencv_contrib
[ 81%] Built target opencv_python
[ 81%] Built target opencv_haartraining_engine
[ 81%] Built target opencv_createsamples
[ 81%] Built target opencv_haartraining
[ 82%] Built target opencv_performance
[ 83%] Built target opencv_traincascade
[ 83%] Built target opencv_gpu_pch_dephelp
[ 83%] Built target pch_Generate_opencv_gpu
[ 86%] Built target opencv_gpu
[ 86%] Built target opencv_ts
[ 86%] Built target opencv_test_pch_dephelp
[ 86%] Built target pch_Generate_opencv_test
[ 94%] Built target opencv_test
[ 94%] Built target opencv_test_core_pch_dephelp
[ 95%] Built target pch_Generate_opencv_test_core
[ 97%] Built target opencv_test_core
[ 98%] Built target opencv_test_ml
[100%] Built target opencv_test_gpu
Install the project...
-- Install configuration: "Release"
-- Installing: /usr/local/share/opencv/OpenCVConfig.cmake
-- Installing: /usr/local/lib/pkgconfig/opencv.pc
-- Installing: /usr/local/include/opencv/cv.h
-- Installing: /usr/local/include/opencv/cv.hpp
-- Installing: /usr/local/include/opencv/cvaux.h
-- Installing: /usr/local/include/opencv/cvaux.hpp
-- Installing: /usr/local/include/opencv/cvwimage.h
-- Installing: /usr/local/include/opencv/cxcore.h
-- Installing: /usr/local/include/opencv/cxcore.hpp
-- Installing: /usr/local/include/opencv/cxeigen.hpp
-- Installing: /usr/local/include/opencv/cxmisc.h
-- Installing: /usr/local/include/opencv/highgui.h
-- Installing: /usr/local/include/opencv/ml.h
-- Installing: /usr/local/include/opencv2/opencv.hpp
-- Installing: /usr/local/lib/libopencv_calib3d.2.2.0.dylib
-- Up-to-date: /usr/local/lib/libopencv_calib3d.2.2.dylib
-- Up-to-date: /usr/local/lib/libopencv_calib3d.dylib
-- Installing: /usr/local/include/opencv2/calib3d/calib3d.hpp
-- Installing: /usr/local/lib/libopencv_core.2.2.0.dylib
-- Up-to-date: /usr/local/lib/libopencv_core.2.2.dylib
-- Up-to-date: /usr/local/lib/libopencv_core.dylib
-- Installing: /usr/local/include/opencv2/core/core.hpp
-- Installing: /usr/local/include/opencv2/core/core_c.h
-- Installing: /usr/local/include/opencv2/core/eigen.hpp
-- Installing: /usr/local/include/opencv2/core/internal.hpp
-- Installing: /usr/local/include/opencv2/core/mat.hpp
-- Installing: /usr/local/include/opencv2/core/operations.hpp
-- Installing: /usr/local/include/opencv2/core/types_c.h
-- Installing: /usr/local/include/opencv2/core/version.hpp
-- Installing: /usr/local/include/opencv2/core/wimage.hpp
-- Installing: /usr/local/lib/libopencv_features2d.2.2.0.dylib
-- Up-to-date: /usr/local/lib/libopencv_features2d.2.2.dylib
-- Up-to-date: /usr/local/lib/libopencv_features2d.dylib
-- Installing: /usr/local/include/opencv2/features2d/features2d.hpp
-- Installing: /usr/local/lib/libopencv_flann.2.2.0.dylib
-- Up-to-date: /usr/local/lib/libopencv_flann.2.2.dylib
-- Up-to-date: /usr/local/lib/libopencv_flann.dylib
-- Installing: /usr/local/include/opencv2/flann/all_indices.h
-- Installing: /usr/local/include/opencv2/flann/allocator.h
-- Installing: /usr/local/include/opencv2/flann/autotuned_index.h
-- Installing: /usr/local/include/opencv2/flann/composite_index.h
-- Installing: /usr/local/include/opencv2/flann/dist.h
-- Installing: /usr/local/include/opencv2/flann/flann.hpp
-- Installing: /usr/local/include/opencv2/flann/flann_base.hpp
-- Installing: /usr/local/include/opencv2/flann/general.h
-- Installing: /usr/local/include/opencv2/flann/ground_truth.h
-- Installing: /usr/local/include/opencv2/flann/hdf5.h
-- Installing: /usr/local/include/opencv2/flann/heap.h
-- Installing: /usr/local/include/opencv2/flann/index_testing.h
-- Installing: /usr/local/include/opencv2/flann/kdtree_index.h
-- Installing: /usr/local/include/opencv2/flann/kmeans_index.h
-- Installing: /usr/local/include/opencv2/flann/linear_index.h
-- Installing: /usr/local/include/opencv2/flann/logger.h
-- Installing: /usr/local/include/opencv2/flann/matrix.h
-- Installing: /usr/local/include/opencv2/flann/nn_index.h
-- Installing: /usr/local/include/opencv2/flann/object_factory.h
-- Installing: /usr/local/include/opencv2/flann/random.h
-- Installing: /usr/local/include/opencv2/flann/result_set.h
-- Installing: /usr/local/include/opencv2/flann/sampling.h
-- Installing: /usr/local/include/opencv2/flann/saving.h
-- Installing: /usr/local/include/opencv2/flann/simplex_downhill.h
-- Installing: /usr/local/include/opencv2/flann/timer.h
-- Installing: /usr/local/lib/libopencv_highgui.2.2.0.dylib
-- Up-to-date: /usr/local/lib/libopencv_highgui.2.2.dylib
-- Up-to-date: /usr/local/lib/libopencv_highgui.dylib
-- Installing: /usr/local/include/opencv2/highgui/highgui_c.h
-- Installing: /usr/local/include/opencv2/highgui/highgui.hpp
-- Installing: /usr/local/lib/libopencv_imgproc.2.2.0.dylib
-- Up-to-date: /usr/local/lib/libopencv_imgproc.2.2.dylib
-- Up-to-date: /usr/local/lib/libopencv_imgproc.dylib
-- Installing: /usr/local/include/opencv2/imgproc/imgproc.hpp
-- Installing: /usr/local/include/opencv2/imgproc/imgproc_c.h
-- Installing: /usr/local/include/opencv2/imgproc/types_c.h
-- Installing: /usr/local/lib/libopencv_legacy.2.2.0.dylib
-- Up-to-date: /usr/local/lib/libopencv_legacy.2.2.dylib
-- Up-to-date: /usr/local/lib/libopencv_legacy.dylib
-- Installing: /usr/local/include/opencv2/legacy/blobtrack.hpp
-- Installing: /usr/local/include/opencv2/legacy/compat.hpp
-- Installing: /usr/local/include/opencv2/legacy/legacy.hpp
-- Installing: /usr/local/include/opencv2/legacy/streams.hpp
-- Installing: /usr/local/lib/libopencv_contrib.2.2.0.dylib
-- Up-to-date: /usr/local/lib/libopencv_contrib.2.2.dylib
-- Up-to-date: /usr/local/lib/libopencv_contrib.dylib
-- Installing: /usr/local/include/opencv2/contrib/contrib.hpp
-- Installing: /usr/local/lib/libopencv_ml.2.2.0.dylib
-- Up-to-date: /usr/local/lib/libopencv_ml.2.2.dylib
-- Up-to-date: /usr/local/lib/libopencv_ml.dylib
-- Installing: /usr/local/include/opencv2/ml/ml.hpp
-- Installing: /usr/local/lib/libopencv_objdetect.2.2.0.dylib
-- Up-to-date: /usr/local/lib/libopencv_objdetect.2.2.dylib
-- Up-to-date: /usr/local/lib/libopencv_objdetect.dylib
-- Installing: /usr/local/include/opencv2/objdetect/objdetect.hpp
-- Installing: /usr/local/lib/python2.7/site-packages/cv.so
-- Installing: /usr/local/lib/libopencv_video.2.2.0.dylib
-- Up-to-date: /usr/local/lib/libopencv_video.2.2.dylib
-- Up-to-date: /usr/local/lib/libopencv_video.dylib
-- Installing: /usr/local/include/opencv2/video/background_segm.hpp
-- Installing: /usr/local/include/opencv2/video/tracking.hpp
-- Installing: /usr/local/bin/opencv_haartraining
-- Installing: /usr/local/bin/opencv_createsamples
-- Installing: /usr/local/bin/opencv_performance
-- Installing: /usr/local/bin/opencv_traincascade
-- Installing: /usr/local/lib/libopencv_gpu.2.2.0.dylib
-- Up-to-date: /usr/local/lib/libopencv_gpu.2.2.dylib
-- Up-to-date: /usr/local/lib/libopencv_gpu.dylib
-- Installing: /usr/local/include/opencv2/gpu/devmem2d.hpp
-- Installing: /usr/local/include/opencv2/gpu/gpu.hpp
-- Installing: /usr/local/include/opencv2/gpu/matrix_operations.hpp
-- Installing: /usr/local/include/opencv2/gpu/stream_accessor.hpp
-- Installing: /usr/local/share/opencv/doc/haartraining.htm
-- Installing: /usr/local/share/opencv/doc/CMakeLists.txt
-- Installing: /usr/local/share/opencv/doc/license.txt
-- Installing: /usr/local/share/opencv/doc/packaging.txt
-- Installing: /usr/local/share/opencv/doc/README.txt
-- Installing: /usr/local/share/opencv/doc/opencv.jpg
-- Installing: /usr/local/share/opencv/doc/opencv-logo.png
-- Installing: /usr/local/share/opencv/doc/opencv-logo2.png
-- Installing: /usr/local/share/opencv/doc/opencv.pdf
-- Installing: /usr/local/share/opencv/doc/opencv_cheatsheet.pdf
-- Installing: /usr/local/share/opencv/doc/pattern.pdf
-- Installing: /usr/local/share/opencv/doc/papers/algo_tracking.pdf
-- Installing: /usr/local/share/opencv/doc/papers/camshift.pdf
-- Installing: /usr/local/share/opencv/doc/papers/avbpa99.ps
-- Installing: /usr/local/share/opencv/doc/vidsurv/Blob_Tracking_Modules.doc
-- Installing: /usr/local/share/opencv/doc/vidsurv/Blob_Tracking_Tests.doc
-- Installing: /usr/local/share/opencv/doc/vidsurv/TestSeq.doc
-- Installing: /usr/local/share/opencv/haarcascades/haarcascade_eye.xml
-- Installing: /usr/local/share/opencv/haarcascades/haarcascade_eye_tree_eyeglasses.xml
-- Installing: /usr/local/share/opencv/haarcascades/haarcascade_frontalface_alt.xml
-- Installing: /usr/local/share/opencv/haarcascades/haarcascade_frontalface_alt2.xml
-- Installing: /usr/local/share/opencv/haarcascades/haarcascade_frontalface_alt_tree.xml
-- Installing: /usr/local/share/opencv/haarcascades/haarcascade_frontalface_default.xml
-- Installing: /usr/local/share/opencv/haarcascades/haarcascade_fullbody.xml
-- Installing: /usr/local/share/opencv/haarcascades/haarcascade_lefteye_2splits.xml
-- Installing: /usr/local/share/opencv/haarcascades/haarcascade_lowerbody.xml
-- Installing: /usr/local/share/opencv/haarcascades/haarcascade_mcs_eyepair_big.xml
-- Installing: /usr/local/share/opencv/haarcascades/haarcascade_mcs_eyepair_small.xml
-- Installing: /usr/local/share/opencv/haarcascades/haarcascade_mcs_lefteye.xml
-- Installing: /usr/local/share/opencv/haarcascades/haarcascade_mcs_mouth.xml
-- Installing: /usr/local/share/opencv/haarcascades/haarcascade_mcs_nose.xml
-- Installing: /usr/local/share/opencv/haarcascades/haarcascade_mcs_righteye.xml
-- Installing: /usr/local/share/opencv/haarcascades/haarcascade_mcs_upperbody.xml
-- Installing: /usr/local/share/opencv/haarcascades/haarcascade_profileface.xml
-- Installing: /usr/local/share/opencv/haarcascades/haarcascade_righteye_2splits.xml
-- Installing: /usr/local/share/opencv/haarcascades/haarcascade_upperbody.xml
-- Installing: /usr/local/share/opencv/lbpcascades/lbpcascade_frontalface.xml
new-host:OpenCV-2.2.0 ely$ python
ActivePython 2.7.1.4 (ActiveState Software Inc.) based on
Python 2.7.1 (r271:86832, Feb 7 2011, 11:33:10)
[GCC 4.2.1 (Apple Inc. build 5664)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: dlopen(/usr/local/lib/python2.7/site-packages/cv.so, 2): no suitable image found. Did find:
/usr/local/lib/python2.7/site-packages/cv.so: mach-o, but wrong architecture
>>> exit()
And just to be sure, based on the Python path that it found during the install, I tried:
new-host:OpenCV-2.2.0 ely$ /usr/local/bin/python2.7
ActivePython 2.7.1.4 (ActiveState Software Inc.) based on
Python 2.7.1 (r271:86832, Feb 7 2011, 11:33:10)
[GCC 4.2.1 (Apple Inc. build 5664)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: dlopen(/usr/local/lib/python2.7/site-packages/cv.so, 2): no suitable image found. Did find:
/usr/local/lib/python2.7/site-packages/cv.so: mach-o, but wrong architecture
It seems that no matter what I do, I get this architecture error. I've installed OpenCV straight through, no problems, with and without this architecture string specifier in the CMakeCache.txt, and both ways result in the same error.
I appreciate the help, any other ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我用 ActivePython 2.7 成功构建了 OpenCV 2.2。
要构建 32 位,您需要:
CMAKE_OSX_ARCHITECTURES:STRING=i386
添加到 CMakeCache.txt(在运行cmake
后立即)cmake
如果您需要我遵循的完整构建说明,请告诉我......我将更新此答案。
I successfully built OpenCV 2.2 with ActivePython 2.7.
To build for 32-bit you need to:
CMAKE_OSX_ARCHITECTURES:STRING=i386
to your CMakeCache.txt (right after runningcmake
)cmake
If you need the full build instructions I followed, let me know ... I'll update this answer.