7 Installation under Windows is pretty strightforward.
8 Download executable installation from SourceForge and run it.
9 It installs OpenCV, registers DirectShow filters and performs
10 other post-installation procedures.
11 After that you can start using OpenCV.
13 Building OpenCV from sources
14 ----------------------------
16 Also, it is possible to build the modified OpenCV from source, or
17 build the latest OpenCV snapshot,
18 obtained from SourceForge CVS (see http://sourceforge.net/cvs/?group_id=22870).
20 +++ These are instructions for MSVC 6.0, MSVC.NET 2003 and MSVC.NET 2005
22 * Specify the appropriate CVSROOT (see the link above) in WinCVS and
23 checkout the module "opencv".
24 * Open opencv\_make\opencv.dsw (in case of MSVC 6.0 or MSVC.NET 2003, in the latter
25 case they will be converted to MSVC.NET 2003 project files),
26 or opencv\_make\opencv.sln (in case of MSVC.NET 2005)
27 * Select the configuration of interest, for example, Win32 Release, and build it.
28 * Add opencv\bin to the system PATH.
29 The path can be modified at
30 MyComputer--[right button click]-->Properties->Advanced->Environment Variables.
32 +++ One may also build OpenCV with command-line tools from Microsoft Platform SDK
33 (Intel compiler can optionally be used instead of the one from Microsoft),
34 or with MinGW - native GNU C/C++ port to Win32.
35 The platforms supported are: Win32 on IA32, Win64 on EM64T/AMD64, Win64 on Itanium.
37 * Install platform SDK or MinGW (with GCC 3.x or 4.x),
38 Intel Compiler 9.0 or later (if needed)
39 * Edit opencv\_make\make_cfg.mak, correct the paths to the SDK and ICC.
40 * In the command-line prompt:
41 * Enter opencv\_make directory
42 * Run of the following:
43 nmake /f makefile.32 - build IA32 version with cl compiler
44 nmake /f makefile.icc - build IA32 version with icc (icl) compiler
45 nmake /f makefile.vs - build IA32 version with cl compiler,
46 environment variables are used instead of the Platform SDK.
47 (ideal as command-line alternative to MSVC 6.0)
48 nmake /f makefile.64 - build EM64T/AMD64 version using Platform SDK
49 (the produced DLLs will have _64 suffix)
50 nmake /f makefile.i7 - build Itanium version using Platform SDK
51 (the produced DLLs will have _i7 suffix).
53 mingw32-make -f make_all_gnu.mak - build IA32 version with gcc compiler
54 (Make sure that <gcc_root>\bin is in the system path.
55 To build VFW-enabled highgui, read instructions in
56 opencv\otherlibs\_graphics\readme.txt)
58 How to test built OpenCV binaries
59 ---------------------------------
61 Build and run samples at opencv\samples\c.
62 (Note: some of the demos need an AVI file or a camera, e.g. motempl.c)
64 or run algorithmic tests: opencv\bin\cxcoretest.exe, opencv\bin\cvtest.exe.
65 It will produce cxcoretest.sum and cvtest.sum, respectively, that should hopefully
68 How to add IPP support
69 ----------------------
71 + Obtain IPP from Intel site (http://www.intel.com/software/products/ipp/index.htm),
72 version 5.1 or later is preferrable, and install it.
73 + Make sure the appropriate binary folder
74 (e.g. c:\program files\intel\ipp\5.1\ia32\bin) is in the system path.
75 + That's it. IPP should be automatically detected by OpenCV and loaded at runtime.
76 + To smaller memory footprint and shorter application loading time,
77 it is possible to build custom IPP dll for OpenCV, ippopencv*.dll, see interfaces\ipp.
78 + It is possible to load/unload IPP at runtime, see cvUseOptimized() function.
84 There are no prebuilt binaries for Linux versions (because of a large variety of
85 different versions of GCC and GLIBC in different distributions) from our side. So, if
86 your distributor (SuSE, Debian, Ubuntu) doesn't offer OpenCV, you'll have
87 to build it from sources.
89 That's what you need to build fully-functionaly libraries and demos:
92 + GTK+ 2.x or higher including headers
96 + libpng, zlib, libjpeg, libtiff, libjasper with development files.
98 + Python 2.3, 2.4 or 2.5 with headers installed (developer package)
100 + libavcodec, etc. from ffmpeg 0.4.9-pre1 or later + headers.
101 Earlier versions do not work with OpenCV because of different API.
102 libavcodec is LGPL software, so to use it with non-GPL software (such as OpenCV)
103 you need to build and use a _shared_ library libavcodec.so.*:
104 get ffmpeg from ffmpeg.sourceforge.net
105 ./configure --enable-shared
108 you will have got: /usr/local/lib/libavcodec.so.*
109 /usr/local/lib/libavformat.so.*
110 (/usr/local/lib/libavutil.so.* for newer versions)
111 /usr/local/include/ffmpeg/*.h
116 a) if your distribution uses RPM, you may build RPMs using:
117 rpmbuild -ta OpenCV-x.y.z.tar.gz (for RPM 4.x or later) or
118 rpm -ta OpenCV-x.y.z.tar.gz" (for eariler versions of RPM)
119 where OpenCV-x.y.z.tar.gz should be put to /usr/src/redhat/SOURCES/ or
122 it will build OpenCV-x.y.z.*.rpm
123 (there is no OpenCV-devel, everything is in one package)
126 rpm -i OpenCV-x.y.z.*.rpm
128 b) if your distribution does not support RPM, build and install it
129 in Unix/Linux traditional way:
136 You can influence which libraries are used and which features are
137 enabled by specifying the appropriate flags to ./configure.
139 See './configure --help' for more information.
142 both a&b (post-install))
144 default installation path is /usr/local/lib and /usr/local/include/opencv,
145 so you need to add /usr/local/lib to /etc/ld.so.conf (and run ldconfig after)
146 or add it to LD_LIBRARY_PATH environment variable
148 c) if you want to step in as an OpenCV developer, you will need some additional tools:
150 autoconf-2.59 (including autoheader-2.59)
151 automake-1.9* (including aclocal-1.9*)
152 libtool-1.5 (including libtoolize-1.5)
153 swig (version 1.3.30 or current CVS version respectively)
155 If the default versions of these tools installed on your machine differs, you
156 should specify the paths to the required versions via environment variables. For
157 example, if 'automake --version' gives you a version number 1.7.x but there is
158 /usr/bin/automake-1.9 installed on your machine, then call
160 export AUTOMAKE=/usr/binautomake-1.9
162 whenever you want to work on OpenCV sources.
164 In addition, you should 'configure --enable-maintainer-mode', so that all
165 autotools are invoked automagically, if Makefile's or the configure-script
166 need to be regenerated. You can manually regenerate everything by starting
167 'autoreconf' from the top directory.
173 + You can compile test programs using the traditional check target
174 of automake projects:
178 This implicitly runs the folowing test programs:
181 tests/cxcore/src/cxcoretest
184 compile and run simple c examples at
185 /usr/local/share/opencv/samples, e.g.:
187 g++ `pkg-config --cflags opencv` -o morphology morphology.c `pkg-config --libs opencv`
188 Plain gcc won't work because of unresolved c++-specific symbols (located in highgui?)
191 How to make OpenCV use IPP:
195 Let's assume, it installs to /opt/intel/ipp/5.1/ia32.
197 + add <install_path>/bin and <install_path>/bin/linux32
198 (for example, /opt/intel/ipp/5.1/ia32/bin and /opt/intel/ipp/5.1/ia32/bin/linux32)
199 to LD_LIBRARY_PATH in your initialization script (.bashrc or similar):
201 LD_LIBRARY_PATH=/opt/intel/ipp/5.1/ia32/bin:/opt/intel/ipp/5.1/ia32/bin/linux32:$LD_LIBRARY_PATH
202 export LD_LIBRARY_PATH
204 or add these two directories, one per line, to /etc/ld.so.conf and run
207 + that's it. Now OpenCV should be able to locate IPP shared libraries and make use of them.
213 (TODO: add more detailed description)
214 (see also OpenCV Wiki)
216 + Basically, the requirements and building instructions are very similar to Linux case,
217 with the following exceptions:
219 * Carbon is used instead of GTK+ by default
220 * Quicktime is used instead of FFMPEG/xine by default
221 * pkg-config is optional (it is only used explicitly in samples\c\build_all.sh script)
222 * RPM and ldconfig are not supported by default,
223 use configure+make+sudo make install to build and install OpenCV,
224 update LD_LIBRARY_PATH (unless ./configure --prefix=/usr is used).
226 * for full functionality, you should install libpng, libtiff, libjpeg and libjasper
227 from darwinports and/or fink and make them available to ./configure (see ./configure --help)
231 * Currently there is no way to write AVI files with QuickTime
232 * A plain OS X system doesn't have libpng, libtiff, libjasper installed, so
233 you won't be able to read or write these image formats
234 * The build system doesn't allow to build functional universal libraries at this time
235 * The build system doesn't allow to build with the intel compiler on OS X at this time
237 + If you'd like to step in as a developer, you will need to get the appropriate
238 versions of automake, etc. (see Linux section) from darwinports.
243 Although there is no official support for non-x86 based
244 processors it is reportedly possible to compile OpenCV on ARM.
246 * on ARM pass CXXFLAGS=-fsigned-char to configure.