I was having exactly the same issue reported by mjepson and tvdev. It seems there's a small configuration problem with Qt 4.7.4 (my QtCreator's about window says it's 4.7.4, but the version I installed was 4.8.1, though!) and gcc on the new Mac OS X 10.8 Mountain Lion. OpenCV is a BSD-licensed library for digital image processing which implements several hundred computer vision algorithms. Unfortunately compiling it on the Mac was not straightforward—requiring Fink or MacPorts —and the one existing Mac framework was out of date and no longer maintained. OpenCV On Mac: How To Get It Up And Running? OpenCV is a computer vision library used extensively by people in the computer vision field. Until a couple of years ago, OpenCV was a bit hacky and the usage was not very straightforward. But determined efforts by multiple companies finally standardized the process and now it is nice and clean.
I have used OpenCV with Qt Creator on Windows, but now wanted to use it on Mac OS X too. https://tjkbeo.weebly.com/blog/racing-games-for-mac. So I installed 2.4.2, used CMake to make and build (install) the whole, which went without any problems.But, when I add #include <cv.hpp> to one of my files, I get the following error 5 times:
/usr/local/include/opencv2/flann/params.h:87: error: explicit instantiation of 'std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, const std::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>]' but no definition available
The code around the error is this:
with the error occurring in the line with std::cout << it->first ..
I can't figure out why this is happening. Any help is greatly appreciated!
editretagflag offensiveclosemergedelete
Comments
I don't know what IndexParams means, but try to take it->first in a separate line and return it's value and try to print it's fields firstly then if every thing is ok, So 'cout << it->first' is illegal.
Well, this is code from OpenCV itself, which worked in Mac OS X 10.7. It works as it is on Windows too, so I don't think there's really anything wrong with it. Also, the error complains about the explicit instantiation of std::basic_ostream(etc.), which would be cout I guess. The file has an #include <iostream>, so it should be able to use std::cout.
OpenCV is the world’s most popular computer vision library and it’s used extensively by researchers and developers around the world. OpenCV has been around for a while now and they add something new and interesting with every new release. One of the main additions of OpenCV 3 is “opencv_contrib” which contains a lot of cutting edge algorithms for feature descriptors, text detection, object tracking, shape matching, and so on. They have greatly improved Python support in this release as well. Since OpenCV is available on almost all the popular platforms, this version looks very promising. Let’s see how to install OpenCV 3 with Python support on Mac OS X.
Prerequisites
Mcafee antivirus for macbook air. CMake: Make sure you have cmake. If you don’t, you can download it from here. It’s a dmg file, so you can just download it and run the installer.
Install Python using Homebrew: This is an important step! Homebrew is a package manager for OS X that makes our lives easier in many different ways. Instead of using system Python, we need to use brewed Python (this is basically Python installed using Homebrew). If you don’t have Homebrew, you can install it using the following command:
Now that Homebrew is installed, let’s update it and install Python:
Microsoft office for mac student. Open up your ~/.profile file and add the following line:
We need to reload the file to update the environment variables. Run the following command to do it:
Let’s confirm that you are using brewed Python. Run the following command from your terminal:
If you see “/usr/local/bin/python” printed on your terminal, you can proceed.
Download OpenCV 3.0.0: You can download it from here.
Download “opencv_contrib”: As discussed earlier, we can use the latest computer vision algorithms from “opencv_contrib”. It is basically a repository that contains state of the art algorithms. Bear in mind that some of them are not free for commercial use, but it is great tool to learn new algorithms. Download opencv_contrib from here.
We are now ready to build. Run the following commands from you terminal:
Let’s take a moment to understand what these flags mean exactly:
Opencv Download For Mac Os X
Let’s go ahead and install OpenCV 3.0.0. Make sure you are inside the directory “/path/to/opencv-3.0.0/build” and run the following commands:
The “-j4” flag indicates that it should use 4 cores. We are not done yet! Let’s set the library path:
If you want to make it permanent, just add the following line in your “~/.profile” file:
We need to copy the pkg-config file “opencv.pc” to “/usr/local/lib/pkgconfig” and name it “opencv3.pc” so that it doesn’t conflict with our existing OpenCV 2.4.x config file:
We also need to update our PKG_CONFIG_PATH environment variable to make sure it knows where opencv3.pc is located. Open up your “~/.profile” file and add the following line:
Opencv For Mac C++
Reload your “~/.profile” file.
Let’s see if OpenCV with C++ is working:
If you see “Welcome to OpenCV 3.0.0” printed on the terminal, you are good! Let’s check the OpenCV-Python version:
Download Opencv For Mac
You should see “3.0.0” printed on the terminal. If you see that, then you are done! You have successfully installed OpenCV 3 with Python support on Mac OS X. Let’s check if it’s working by using something that exists in OpenCV 3.0.0 but not in OpenCV 2.4.9. Go into Python shell by typing “python” in your terminal and run the following commands:
If the above line doesn’t throw an error, then you are all set! You have now successfully verified your OpenCV 3 installation with Python support.
———————--—————-—————————————————————–
Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |