2009-10-03 6 views
4

Je ne suis pas un gars Unix, donc j'ai essayé d'installer OpenCV 2.0 pour les jours avec des succès. Je viens de télécharger le formulaire de la bibliothèque OpenCV sourceforge de cette page: http://sourceforge.net/projects/opencvlibrary/ Sait-on les commandes du terminal unix exactes pour l'installer?Comment installer OpenCV2.0 sous Mac OS 10.6.1 (Snow Leopard)

s'il vous plaît ne dites pas « aller à Google », je l'ai déjà fait. J'ai trouvé ceci: http://opencv.willowgarage.com/wiki/InstallGuide et ce http://opencv.willowgarage.com/wiki/Mac_OS_X_OpenCV_Port mais les explications ne sont pas très bonnes pour les débutants unix.

L'installation échoue toujours à la fin.

Ce serait génial si je peux faire un cadre. par exemple OpenCV.framework de la source actuelle, donc je peux l'utiliser avec Xcode, et Cocoa plus facile.

grâce

je l'ai fait:

téléchargé. l'a extrait.

cd Downloads/OpenCV-2.0.0 
./make_frameworks.sh 

et obtenu ceci lors de la liaison de tous les fichiers .o.

mv -f .deps/saving.Tpo .deps/saving.Plo 
mv -f .deps/logger.Tpo .deps/logger.Plo 
mv -f .deps/index_testing.Tpo .deps/index_testing.Plo 
libtool: link: (cd .libs/lib_clapack.lax/lib_clapack_floatstore.a && ar x "/Users/nacho4d/Downloads/OpenCV-2.0.0 3/build_i386/3rdparty/./.libs/lib_clapack_floatstore.a") 
../libtool: line 961: cd: .libs/lib_clapack.lax/lib_clapack_floatstore.a: No such file or directory 
make[2]: *** [lib_clapack.la] Error 1 
make[2]: *** Waiting for unfinished jobs.... 
mv -f .deps/flann.Tpo .deps/flann.Plo 
make[1]: *** [all-recursive] Error 1 
make: *** [all] Error 2 
Creating universal Framework 
============================================= 
cp: build_ppc/OpenCV.framework: No such file or directory 
lipo: can't open input file: build_ppc/OpenCV.framework/OpenCV (No such file or directory) 
Done 

!

Ai-je besoin de faire quelque chose avant d'exécuter le script shell?

EDIT: Pour l'intéressé, je l'ai écrit un post sur la façon d'installer et d'utiliser OpenCV 2.1.1 sur Mac ici: http://nacho4d-nacho4d.blogspot.com/2010/07/blog-post.html

+0

Comment cela échoue-t-il exactement? – ShiDoiSi

+0

J'ai mis à jour la question avec l'erreur que j'ai lors de l'exécution du script shell. – nacho4d

+0

J'ai un petit message comment installer OpenCV 2.1.1 dans les Macs. http://nacho4d-nacho4d.blogspot.com/2010/07/blog-post.html – nacho4d

Répondre

0

Ok, je viens résolu. En fait, il y a un bug quelque part, car si votre chemin contient un espace, les scripts shell échoueront.

par exemple.

$pwd 
/Users/nacho4d/Downloads/OpenCV-2.0.0 3 
$./make_frameworks.sh 

ce échouera parce que le dossier actuel "OpenCV-2.0.0 3" dispose d'un espace.

Il m'a fallu plusieurs heures pour réaliser cela. ; (

Cordialement

+0

Pour les intéressés: J'ai un petit post comment installer OpenCV 2.1.1 sur Mac. http://nacho4d-nacho4d.blogspot.com/2010/07/blog-post.html 2.1 utilise Cocoa. Donc fonctionne mieux sur les macs. – nacho4d

1

j'ai eu un problème de compilation sur Snow Leopard aussi, mais a pu obtenir de travailler en suivant les instructions à l'adresse: http://opencv.willowgarage.com/wiki/Mac_OS_X_OpenCV_Port

La seule modification que je devais faire était aussi désactiver ffmpeg à l'intérieur de ccmake

The GNU autotools methods (make && make install) are being outdated. Volunteers to edit this section?

mkdir opencv/build cd opencv/build cmake .. ccmake .

If you are on Snow Leopard, hit 't' to toggle advanced mode. Set CMAKE_CXX_COMPILER="/usr/bin/g++-4.0" and CMAKE_C_COMPILER="/usr/bin/gcc-4.0" and then continue with the following steps.

Hit 'c' to configure. Hit 'g' to generate the config file and exit ccmake.

make -j8 sudo make install

If you hit the following build error:

/Users/awagner/Developer/opencv2/src/highgui/grfmt_tiff.cpp:292: error: ‘fmtSignTiffII’ was not declared in this scope make[2]: * [src/highgui/CMakeFiles/highgui.dir/grfmt_tiff.o] Error 1 make 1 : * [src/highgui/CMakeFiles/highgui.dir/all] Error 2

you can get the build to complete by commenting out line 292 of src/highgui/grfmt_tiff.cpp and running make again. (This probably breaks something in TIFF export, but the build at least completes)

1

TL; DR du nacho4d de liaison publiée:

/usr/bin/ruby -e "$(/usr/bin/curl -fksSL https://raw.github.com/mxcl/homebrew/master/Library/Contributions/install_homebrew.rb)" 
brew install opencv 

et après environ 30 minutes de crunching, vous devriez avoir installé OpenCV.

...

Cependant, si vous obtenez une erreur de brasser lorsque son essayant d'installer OpenCV alors lisez ceci: https://github.com/mxcl/homebrew/pull/6424#issuecomment-2333585 et modifier la recette de bière avec:

export EDITOR nano # optional, but for novices nano is easier than vim 
brew edit opencv 

puis exécutez brew install opencv à nouveau.

Questions connexes