Sunday, June 19, 2011

Semaine 12 dimanche

~ dimanche ~


OpenCV on Mac OS X

Installed OpenCV on Mac. About the same process as in Linux (thankfully), besides just installing the Xcode package instead of using yum in Fedora, and installing pkg-config manually:

Download pkg-config for Mac OS X:http://mac.softpedia.com/get/Developer-Tools/pkg-config.shtml
OR direct link
http://pkgconfig.freedesktop.org/releases/pkg-config-0.23.tar.gz

Unzip it into wherever.
Go into that directory
$ cd <pkg-config unzipped dir>
$ ./configure
$ make
$ sudo make install

Then set the environment variables just as in Linux:

$ export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
$ export LD_LIBRARY_PATH=/usr

Check it by running these two commands, should have something similar, in your /
usr/local/...:

$ pkg-config --cflags opencv
-I/usr/local/include/opencv -I/usr/local/include

$ pkg-config --libs opencv-L/usr/local/lib -lopencv_core -lopencv_imgproc -lopencv_highgui -lopencv_ml -lopencv_video -lopencv_features2d -lopencv_calib3d -lopencv_objdetect -lopencv_con
trib -lopencv_legacy -lopencv_flann

For the compile lines to use in Makefile, see the Linux installation guide posted before.


Xcode is so big... - - a 4 GB download for 3+ hours and 10 GB install... O_O They should have optional packages so that we can choose to only download the UNIX development package...

Some of my built-in tests in test_cv.sh failed though, with errors FAIL(Bad accuracy) and FAIL(Invalid test data). Not sure why, the same process in Linux didn't get me any errors... test_cxcore.sh and test_ml.sh both worked. So I think I'll just ignore the ones that failed in test_cv.sh.

Subversion

Trying to check out the repository on a Mac, which I committed from Linux. Had a bunch problems with subversion, seemed to be caused by files with the same name but different capitalizations, which Linux allows because it's case-sensitive, but other systems don't, so SVN is giving all these errors when I fix and reupdate and fix and reupdate, seemed like a cycle of 3 files.

Initial error looks like:

svn: In directory '.'
svn: Can't open file '.svn/tmp/text-base/foodRecog.cpp.svn-base': No such file or directory


That means there's a file with the same name but different capitalization. Just delete the problematic file from the repository with:
$ svn rm http://repositoryURL/theProblemFile

Run update again. Most likely it won't let you run, saying

svn update
svn: Working copy '.' locked
svn: run 'svn cleanup' to remove locks (type 'svn help cleanup' for details)


Then run
$ svn cleanup
If it doesn't let you run, then do
$ rm .svn/log

Then svn cleanup should run, then svn update should run.
Solve the problem with other files that give the same error. May have to just delete the local copy and make a new folder and check out again.
Otherwise your update may be cycling through this type of errors for several files, even though there is nothing wrong with these files:


svn: Failed to add file 'myResize.sh': an unversioned file of the same name already exists


OR


svn: In directory '.'
svn: Can't move source to dest
svn: Can't move '.svn/prop-base/tempfile.7.tmp' to '.svn/prop-base/Makefile.svn-base': No such file or directory
(this error also means the same capitalization problem. But if this is not the initial error, this file might have no problem at all, it's just that you need to delete this entire folder, make a new one, and do a clean checkout, after you resolve the problems above with the other files. This was the case for me.)


Turns out the way to solve it is that after removing the offending file, don't update in the same directory. Delete it, then do a clean checkout in a new directory. That solved it :) Geez. Now hopefully it'll run on the Mac and we can start expanding our database.

Amazon Mechanical Turk

Thought about it. Looked at it. I think I'll still do some by myself and won't use it until I can't handle it. See how fast I am. If I'm just not fast enough, then I might just start using it. Not too sure how to set up the labeling yet though. I should do some tasks to try out how it works.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home