I had installed opencv 2.4.9 it worked fine but I was not able to use imgproc header and drawMarker functions so I decided to install opencv 4.1.0 and I ran the cmake and everything but when I check the opencv version using pkg-config --modversion opencv it shows 2.4.9.
by the way, I use ubuntu 14.04 and want to use c++ with opencv.
This is a common mistake. People are installing opencv from the first link and it is generally installing opencv 2.4.9 automatically they do not decide the version while installing.
First thing you need to do is to uninstall opencv. There is a post in this link how to uninstall opencv. The way I prefered:
sudo apt-get autoremove opencv-doc opencv-data libopencv-dev libopencv2.4-java libopencv2.4-jni python-opencv libopencv-core2.4 libopencv-gpu2.4 libopencv-ts2.4 libopencv-photo2.4 libopencv-contrib2.4 libopencv-imgproc2.4 libopencv-superres2.4 libopencv-stitching2.4 libopencv-ocl2.4 libopencv-legacy2.4 libopencv-ml2.4 libopencv-video2.4 libopencv-videostab2.4 libopencv-objdetect2.4 libopencv-calib3d2.4
Then you need to install opencv again. I strongly recommend you this link. Read that article carefully and do the steps. You can decide the opencv version in the line for example version 3.4.3:
git checkout 3.4.3
Related
I have a cross platform (Windows + Mac) application, built with QT and C++ libraries, which uses OpenCV. I had previously used an OpenCV version downloaded and compiled on the Mac, but decided to try to use the homebrew version to simplify installation on dev machines.
I did brew install opencv --with-contrib and brew link opencv, and managed to get the program to link and run with the libraries from /usr/local/lib.
Problem is, when I install it on another Mac, the program crashes when I try to run it, saying: Library not loaded: /usr/local/Cellar/ilmbase/2.2.1/lib/libIex-2_2.23.dylib.
I'm not sure what to do. I'm not a Mac expert, and certainly no Homebrew expert. Should I go back to compiling OpenCV myself, or can this be solved?
Thanks.
I faced same issue, but I solved it. homebrew installed latest opencv and dependencies. openexr and ilmbase also installed latest version. but opencv.jar refered specific version of library.(ex libIex-2_2.23.dylib)
So, you'd install ilmbase version 2.2.X. and than solve library issue.
https://github.com/Homebrew/homebrew-core/blob/master/Formula/ilmbase.rb
This link is ilmbase install Formula. You can ckeckout v.2.2 Formula commit.
And than uninstall & re-install ilmbase v.2.2.
My intent is to install opencv for use with C++ on macOs 10.12.6 (16G29). It seems the suggested method is using homebrew to install.
I am following this tutorial: https://www.pyimagesearch.com/2016/12/19/install-opencv-3-on-macos-with-homebrew-the-easy-way/
I used this command to install:
brew install opencv3 --with-contrib --c++11
and everything finished without error but I received the following warnings:
Warning: opencv: this formula has no --c++11 option so it will be ignored!
Warning: opencv: this formula has no --with-contrib option so it will be ignored!
From brew info opencv3:
$ brew info opencv3
opencv: stable 3.3.1 (bottled)
Open source computer vision library
https://opencv.org/
/usr/local/Cellar/opencv/3.3.1_1 (519 files, 95.9MB) *
Poured from bottle on 2017-11-21 at 08:11:10
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/opencv.rb
==> Dependencies
Build: cmake ✘, pkg-config ✘
Required: eigen ✔, ffmpeg ✔, jpeg ✔, libpng ✔, libtiff ✔, openexr ✔, numpy ✔, tbb ✔
==> Requirements
Required: python ✔, python3 ✔
Has anyone had success installing opencv3 for c++ development on macOs?
I was getting the same error. Take a look at the output of "brew info opencv". It turns out that the opencv was moved to homebrew-core:
https://github.com/Homebrew/homebrew-core/blob/master/Formula/opencv.rb
To show the list of available '--with-*' options allowed to be passed to homebrew during an install, use:
brew options opencv
I would assume that it returns nothing, since the formula does not define any such options anymore.
Installing Opencv
If you have not installed opencv, install with:
brew install opencv
This should just install from source by downloading and compiling opencv with the packages listed in the homebrew formula. Since there are currently no options in the opencv formula, passing in something like --with-*, for example --with-contrib, will not be recognized as a valid option. However the formula actually happens to install certain things like contrib by default now.
If you already have opencv installed, try reinstalling:
brew reinstall opencv
This will reinstall from source as well.
(Fyi, recompile takes about 10-20 minutes)
I want to use the GraphicsMagick++ library on a C++ project that I am working on in a Raspberry Pi 3 (Raspbian).
I have installed the package using the following command:
sudo apt-get install libgraphicsmagick++-dev
After playing a bit, I have found that the method Image::extent is not defined on Image.h header, while is is shown on the documentation.
Is there any newer version? How to install it?
You can find all the packages related to libgraphicsmagick in debian on https://packages.debian.org/search?keywords=libgraphicsmagick
Ok, just got my first Raspberry pi (3). Went on to install Opencv 3.1.0 using Adrian's guide:
How to Install Opencv 3 on Raspbian Jessie
Installed OpenCV WITH CONTRIB packages as I knew I would need them.
So OpenCV is working fine now. The issue is when I try to use SIFT:
"'module' object has no attribute 'xfeatures2d'"
I did and still do everything by the book, including working on 'cv' environment etc.
I tried checking the site-packages dir of both the python dir and the 'cv' env dir and couldn't find any mention of 'contrib' or 'xfeatures2d'.
Maybe that's the problem? How can I check that the contrib packages were actually compiled with OpenCV?
Thanks in advance.
Because u installed the latest version in OpenCV where they removed sift and surf, I am not sure how they substitute them, anyway u have to install older version of opencv 3.4.2.16 also make sure that opencv contrib of the same version is installed, thats the last working version working with sift/surf not sure if there are special versions for raspberry pi
I have installed OpenCV 3.0 on my MacBook pro with Yosemite.
Unfortunately, after the installation, I realized that I needed the version 2.4.9 of OpenCV since I'm going to use some libraries that are not already supported by version 3.0.
How can I completely remove the 3.0 version? Is it enough to delete the OpenCV folder?
Step 1: remove OpenCV version 3 or higher
>> pip uninstall opencv-contrib-python //do this if you installed opencv-contrib-python
OR
>> pip uninstall opencv-python // do this if this is your first time
Step 2: download OpenCV version 2.4.9 from Github and save it to your local computer.
Step 3: go to the folder wherever you downloaded, then install OpenCV 2.4.9
You are all set.