Opencv Python Install
So, download and install as any program (dmg): cmake download (look for the Mac OSX 64/32-bit Universal dmg). If you have problems opening, read this. Installing opencv 3.0. First download it from the opencv homepage: opencv3.0 download Select the OpenCV 3.0 (at the time of writing, alpha) for Linux/Mac. We should now unzip it. The Open Source Computer Vision Library, or OpenCV if you prefer, houses over 2500 algorithms, extensive documentation and sample code for real-time computer vision. Advertisement OpenCV focuses mainly towards real-time image processing, as such, if it finds Intel's Integrated Performance Primitives on the system, it will use these commercial.
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it. Oct 09, 2015.
###############################################################
It took me a while, but I did it. I want to migrate my final project to python 3, so I had to use Opencv 3.0.At the moment of writing, the opencv 3.0 is still alpha, but seems stable enough.So, we’ll be using python 3.4 + Opencv 3.0 alpha on OSX 10.9.4. Let’s start.
Installing python3.4
I have installed python3 using homebrew. I recommend using it. In this case,you should only install python3:
If you already have python3, skip this step. You can also install openCV 2.4.9, but at the time of writing there isno option for openCV 3 with python3.You should also install numpy. For that you can use pip (already installed), a python packet manager: Google docs mac osx download.
Installing Cmake
You can also install Cmake with homebrew, but instead, I downloaded it directly from its homepage.This way you have cmake gui, a graphical user interface that makes it easier to manage. So, download and installas any program (dmg): cmake download (look for the Mac OSX 64/32-bit Universal dmg).If you have problems opening, read this
Installing opencv 3.0
First download it from the opencv homepage: opencv3.0 downloadSelect the OpenCV 3.0 (at the time of writing, alpha) for Linux/Mac.We should now unzip it.It’s time to use cmake. Open it from your applications.It asks you to select where the source code is. Navigate to your opencv3.0 folder, previously unzipped.You should also select the build directory (usually you can make a build folder inside the opencv3.0 folder)
This image shows my configuration. You can filter the configuration parameters so it is easier to find.The important ones are those with “python3” prefix.You should set yours depending on your system installation, but if you followed this guide you should set themas they are shown.
So remember to:
Now, click configure. If everything goes fine, now you clickgenerate.If any problem should happen, you can try to detect it by reading theoutput in the bottom of CMAKE. Look for problems related with Python. It would be easier if you copy the text into textedit so you can find words.
All right, time to open a terminal.In the terminal, navigate to the folder where you have your build folder, something like: xd0jnyd.diarynote.jp/202010120435564434/.
Now execute the make command (-jX where X is the number of cores of your CPU, to make compilation faster):
For the next command you need super user privileges:
Checking it all works
If there were no errors, you should be able to import it. Execute this in the terminal:
If there is no Error, congratulations, you have opencv3 with python 3.
Now go out for a beer, you earned it.
What? It didn’t work? No time for beer yet then…
Opencv Mac Os
UPDATE:If you got problems like import error, I recommend that you look careful at the outputs in every step.Actually, you should always do that for everything. Looking for words like ERROR.If you had made it to last step, you can try to uninstall and try configuring and installeing it all again.To uninstall your recently installed openCV you should go to the build directory from the terminal and run this command:
I usually do this for installing newer versions of OpenCV too (OpenCV 3.0 - beta is out now).
If you keep having problems, post them in the comments and I’ll try to help ;)
***************************安装完毕后,可以在ipython3路径中import cv2了。但是还不能在python3中导入cv2----------
经过查询后,发现cv2.so位置是:/usr/local/lib/python3.4/site-packages
因此,在~/.bash_profile中加入了语句
PYTHONPATH='${PYTHONPATH}:/usr/local/lib/python3.4/site-packages”
export PYTHONPATH
即可 --------上面的结果还是不行,结果是Python 3.4.2和 3.4.3冲突所致。
因此我们的解决方案是: 全部删除Python3,然后再brew 安装最新的Python,最终link之即可
----------------------------------------------------
Download wolfram mathematica 9 mac. 要处理avi数据,我们还需要brew install ffmpeg
Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
December 2020
Categories |