OpenCV 2.0 on SnowLeopard 64bit via MacPorts

OpenCV 2.0 on SnowLeopard 64bit via MacPorts

Posted by Matthias in guides | 17 Comments

Updated 1/17/10: The Portfile now includes a “+disable_openmp” variant. I encountered some OpenMP related segfaults in cvCalcOpticalFlowPyrLK which can be prevented with this variant.

In case you need OpenCV 2.0 on SnowLeopard in 64bit and can live without quicktime support (OpenCV 2.0 it has FFMPEG support so you should be OK in most cases) this tutorial is for you.

In case you want OpenCV 2.0 in 32 bit on 10.5 this probably works too, but I haven’t tested it. Just download the attached “Portfile” and follow the short steps underneath:

1. Before starting execute

sudo port selfupdate

so that the most recent dependencies will be installed later on. Otherwise the build might fail.

2. Make your own port directory somewhere, e.g.

/Users/sam/ports

3. Let macports know about it by editing sources.conf, e.g.

> cd /opt/local/etc/macports

> sudo vim sources.conf

4. Add the local port directory to the sources.conf before the rsync:// at the bottom of the file, e.g.

file:///Users/sam/ports # That is 3 slashes after file ;)

5. Create a graphics/OpenCV subfolder so that we have in our example

/Users/sam/ports/graphics/OpenCV

6. Copy the downloaded Portfile into the above directory, make sure it is called Portfile not Portfile.txt

7. Execute portindex in your local port directory, e.g.

> cd /Users/sam/ports

> portindex

You should see a message telling you that the total number of parsed ports is 1

8. Check if OpenCV 2.0 is found

> port search OpenCV

9. Install OpenCV via

> sudo port install OpenCV

or on SnowLeopard in 64 bit but without quicktime support

> sudo port install OpenCV +sl_64bit

10. Enjoy the time you have saved by not having to implement the algorithms in the new MachineLearning package all by yourself ;)

via random thoughts » Blog Archive » OpenCV 2.0 on SnowLeopard 64bit via MacPorts.

0 Responses to “OpenCV 2.0 on SnowLeopard 64bit via MacPorts”


  • No Comments

Leave a Reply