OpenCV version issue
How do I check the current version of OpenCV for Mac and how do I update my version to the most recent version? I am trying to use drawMatchesKNN and drawMatches function. The error I'm getting is something like the name "drawMatches" is not defined. "I know I don't have the correct version of OpenCV. But I don't know how to check my openCV version and update it to the newest version. Version?
source to share
If you are using Python, run below code, get OpenCV version:
import cv2
print cv2.__version__
3.2.0
0 is the latest. As far as upgrading on macOS, if you are using Anaconda it would be easier. You can refer to this page for more information. For labels and related functions to match, it seems like you need modules opencv_contrib
(I haven't tested it yet).
EDIT:
the Anaconda repository has two channels with OpenCV 3.2.0
.
You can try conda install -c menpo opencv3=3.2.0
. This repository menpo
has OpenCV 3.2.0
for Python 2.7/3.4/3.5
and for linux-64
.
The repository conda-forge
conda install -c conda-forge opencv=3.2.0
contains a multidifferential version of the binary at OpenCV 3.2
. You might have checked this conda-forge
if the package menpo
doesn't work. You can check its file page against the available binary.
To remove the conda package, just type conda uninstall opencv3
for OpenCV 3.x
.
OpenCV 3.x
It would be best to uninstall yours before installing OpenCV 2.4.8
to avoid conflict. You can try conda uninstall opencv
for OpenCV 2.x
or find out the package name conda list
.
As far as OSX is concerned, which version are you using?
source to share
It depends on how you installed it. If you are using 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 this:
brew install opencv3
then you need to do:
brew info opencv3
and you can update with:
brew upgrade opencv3
If you've cloned the git repository on github, you need to go to your build directory and run:
more *tmp
and you can update 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
Otherwise, create a simple executable that calls getBuildInformation()
source to share