OpenCV Version Issue

后端 未结 2 1612
栀梦
栀梦 2021-01-15 06:52

How to check the current version of OpenCV for mac and how to update my version to the newest version? I am trying to use the drawMatchesKNN and drawMatches function. The er

相关标签:
2条回答
  • 2021-01-15 07:20

    If you use Python, run below code will get the OpenCV version:

    import cv2
    print cv2.__version__
    
    3.2.0
    

    3.2.0 is the latest one. As for upgrade on macOS, if you are using Anaconda, it would be easier. You may refer to this page to get some more information. For draw matching and related functions, seems you need to have opencv_contrib modules (I haven't checked at the time being).

    EDIT:

    The Anaconda repository has two channels with OpenCV 3.2.0 available.

    You may try conda install -c menpo opencv3=3.2.0. This menpo repository does have OpenCV 3.2.0 for Python 2.7/3.4/3.5 and for linux-64.

    The conda-forge repository, conda install -c conda-forge opencv=3.2.0, has many difference version of binary on OpenCV 3.2. You may have a trial this conda-forge if the menpo package doesn't work. You can check its file page on the binary available.

    To uninstall the conda package, just type conda uninstall opencv3 for OpenCV 3.x.

    Before installing OpenCV 3.x, it would be better to uninstall your OpenCV 2.4.8 to avoid conflict. You may try conda uninstall opencv for OpenCV 2.x or find out the package name by conda list.

    As for the OSX, what are the version you are using?

    0 讨论(0)
  • 2021-01-15 07:33

    It depends how you installed it. If you use homebrew and you did:

    brew install opencv
    

    then, you can get your version with:

    brew info opencv
    

    and you can get the latest version with:

    brew upgrade opencv
    

    If you did:

    brew install opencv3
    

    then you need to do:

    brew info opencv3
    

    and you can upgrade with:

    brew upgrade opencv3
    

    If you cloned the git repo on github, you need to go to your build directory and run:

    more *tmp
    

    and you can upgrade with:

    cd /where/ever/you/cloned/opencv
    git pull
    cd /where/ever/you/built/opencv
    cmake /where/ever/you/cloned/opencv
    make -j 8
    sudo make install
    

    Failing all that, build a simple executable that calls getBuildInformation()

    0 讨论(0)
提交回复
热议问题