OpenCV installation on Mac OS X

前端 未结 2 746
深忆病人
深忆病人 2020-12-05 07:39

I have trawled through all of Google\'s and Stack Overflow\'s search results in order to install stupid OpenCV on my Mac and all the methods have been completely useless.

2条回答
  •  暖寄归人
    2020-12-05 08:18

    Steps for those who prefer to build opencv from source

    I prefer to use cmake-gui instead of entirely doing this from command line, since that gives you more idea about the options available for opencv configuration and bring you in better position if you want to customize opencv build tomorrow ( like enabling java wrapper or OpenCL etc ).

    1. Download source either from opencv.org(1) or opencv github repo(2)
    2. Start cmake-gui.
    3. Set source path to downloaded opencv directory and build path to your choice and click Configure button. enter image description here
    4. Specify generator as unix makefiles and press Continue enter image description here
    5. Choose compilers and click Done button. enter image description here
    6. An options page with errors might be listed.

    enter image description here

    1. Hovering mouse over any option gives a tooltip about the option. Edit option(s) as you feel fit. E.g.
      CMAKE_INSTALL_PREFIX - change opencv install path
      BUILD_SHARED_LIBS - build static or shared library. etc

    Then click Configure again. If there are still errors, edit the option(s) causing the error and click Configure button. Repeat the edit / Configure cycle until there are no more errors. Once there are no more errors, proceed to step (8).

    A minimal sample config of the WITH tab below. Feel free to play with options. This might cause build problems initially. But your understanding of build, will be better. enter image description here

    1. Click Generate to generate make files.
    2. Type make ( in terminal at build folder )
    3. Type make install

提交回复
热议问题