Installing openCV 2.4.2 on Mac OS X 10.9 (Mavericks)

前端 未结 7 544
暗喜
暗喜 2020-12-04 16:06

I\'m trying to install openCV 2.4.2 (not the newest version but stable version compatible with newer OS X according to several sources) on Mac OS X 10.9 (Mavericks). I have

7条回答
  •  时光取名叫无心
    2020-12-04 16:48

    Use macports. Once you install macports, just run

    sudo port install opencv
    

    at the command prompt.

    This other stackoverflow question is mostly correct for how to start using the macports version of opencv in Xcode.

    Here are some more up-to-date instructions for using the macports version of OpenCV from Xcode 5:

    1. Create a new Xcode project as OS X Application -> Command Line Tool, etc.
    2. Click the target in the upper left
    3. Click the Build Settings tab
    4. Scroll down to (or search for) the Search Paths section
    5. Under User Header Search Paths add /opt/local/include
    6. Click the Build Phases tab
    7. Click Link Binary with Libraries
    8. Choose the required libraries from /opt/local/lib
      1. At least, add libopencv_core.dylib
    9. If you want pre-set command-line arguments, go to Product -> Scheme -> Edit Scheme (⌘<)
      1. Click the Run tab on the left
      2. Click the Arguments tab
      3. Enter arguments into Arguments Passed on Launch
    10. Done!

提交回复
热议问题