http://durchblickapp.wordpress.com/2010/04/Week 6: SRS Revisited
Week 8: Face Detection
April 25, 2010
Everything from this week you’ll find in next week’s article: Week 9: Face Detection (Continued).
Week 7: OpenCV Meets the iPhone
April 18, 2010
Compiler flags, cross-compiling, versions, static linking, simulator vs. device—it’s tricky.
Useful links about building OpenCV for other platforms and linking to the library:
- OpenCVWiki explains ways how to build for Mac OS X: Mac OS X OpenCV Port
- Basics of cross-compiling: Cross-compiling for iPhone
- Building for different platforms: Creating an universal static OpenCV library in (Snow) Leopard
- Makefile, patches, good build tutorial and a example project: Using OpenCV on iPhone
- Linking tips: OpenCV vs. Apple iPhone
It seems that dynamic linking with a private .framework
doesn’t work and OpenCV only works linked as a static library.
With all the given work what had to be done:
- Build OpenCV-2.0.0 for iPhone OS 3.1 (simulator and device) according to this good tutorial.
- Under Target > Build > Linking > Other Linker Flags (These flags are passed with all linker invocations. [OTHER_LDFLAGS]) add Build Setting Conditions for Any iPhone Device/Any Architecture and Any iPhone OS Simulator/Any Architecture. Add the flags
-lstdc++
,-lz
,$(SRCROOT)/OpenCV/opencv_{device,simulator}/lib/libcv.a
andlibcxcore.a
- Under Target > Build > Search Paths > Header Search Paths (This is a list of paths to folders to be searched by the compiler for included or imported header files when compiling C, Objective-C, C++, or Objective-C++. Paths are delimited by whitespace, so any paths with spaces in them need to be properly quoted. [HEADER_SEARCH_PATHS, -I]) add Build Setting Conditions for Any iPhone Device/Any Architecture and Any Iphone OS Simulator/Any Architecture. Add the path
$(SRCROOT)/OpenCV/opencv_{device,simulator}/include
without recursive flag. #import <opencv/cv.h>
Other option is adding headers to project and #import "cv.h"
.
The compiler threw some linking warnings like ld: warning: can't add line info to anonymous symbol __ZN2cv9ExceptionD1Ev.lsda from /Users/raff/Development/Durchblick/OpenCV/opencv_simulator/lib/libcxcore.a(lib_cxcore_la-cxmathfuncs.o)
when building for the simulator which I couldn’t solve. I guess I simply could’ve ignore them. When using the precompiled lib there were no warnings.
Week 6: SRS Revisited
April 11, 2010
After last week’s milestone meeting the SRS needed a revision with a lot of good changes.