Skip to content

Commit 4646dbf

Browse files
committed
update README and documentation
1 parent d4b95e7 commit 4646dbf

16 files changed

+5280
-208
lines changed

README.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,18 @@
11
### streamsx.opencv
22

3-
The [OpenCV toolkit for IBM Streams](https://github.com/IBMStreams/streamsx.opencv) allows applications to ingest and process images with the [OpenCV (Open Computer Vision)](http://opencv.org/) library. This version of the toolkit is intended for use with IBM Streams release 4.1 and later.
3+
The [OpenCV toolkit for IBM Streams](http://ibmstreams.github.io/streamsx.opencv/) enables SPL applications to ingest and process images with the [OpenCV (Open Computer Vision)](http://opencv.org/) library. This version of the toolkit is intended for use with IBM Streams release 4.1 and later.
44

5-
For information about the toolkit, please see [http://ibmstreams.github.io/streamsx.opencv/](http://ibmstreams.github.io/streamsx.opencv/).
5+
The toolkit includes step-by-step instructions for installing it, the OpenCV library, and their dependencies, and for verifying that they are working correctly. It also contains documentation for the toolkit's operators. For details, please see:
6+
7+
- [Installing the Toolkit](http://ibmstreams.github.io/streamsx.opencv/doc/html/InstallingToolkit.html)
8+
9+
- [Using the Toolkit](http://ibmstreams.github.io/streamsx.opencv/doc/html/UsingToolkit.html)
10+
11+
- [Sample Applications](http://ibmstreams.github.io/streamsx.opencv/doc/html/SampleApplications.html)
12+
13+
- [Operators and Types](http://ibmstreams.github.io/streamsx.opencv/doc/html/OperatorsAndTypes.html)
14+
15+
For the toolkit's documentation, please see [http://ibmstreams.github.io/streamsx.opencv/doc/html/](http://ibmstreams.github.io/streamsx.opencv/doc/html/).
616

717
For the toolkit's source code, please see [https://github.com/IBMStreams/streamsx.opencv/](https://github.com/IBMStreams/streamsx.opencv/).
818

doc/html/InstallingToolkit.html

Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<meta name="generator" content="pandoc">
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
7+
<title></title>
8+
<style type="text/css">code{white-space: pre;}</style>
9+
<!--[if lt IE 9]>
10+
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
11+
<![endif]-->
12+
</head>
13+
<body>
14+
<h1 id="installing-the-opencv-toolkit">Installing the OpenCV Toolkit</h1>
15+
<p>The OpenCV toolkit for IBM Streams depends upon the <a href="http://opencv.org/">OpenCV (Open Computer Vision)</a> library, which depends upon the <a href="http://ffmpeg.org/">FFmpeg (Fast Forward MPEG)</a> library, which depends upon several other libraries. The toolkit must be installed on the machine where applications will be developed. The libraries must be installed on each machine where applications will be developed or executed.</p>
16+
<p>This section contains instructions for installing several libraries from RHEL or CentOS repositories, then building the FFmpeg and OpenCV libraries from source code, and then finally building the toolkit.</p>
17+
<p>Note: The libraries the toolkit depends upon are covered by a variety of ’open source’ licenses. You should read the license files and check with your legal department before downloading them to ensure you comply with their terms.</p>
18+
<p>The OpenCV toolkit should work on any machine that supports IBM Streams. It has been tested with this environment:</p>
19+
<ul>
20+
<li><p>RHEL or CentOS (64-bit), version 7.1</p></li>
21+
<li><p>FFmpeg library, version 3.0.1</p></li>
22+
<li><p>OpenCV library, version 3.1.0</p></li>
23+
<li><p>IBM Streams, version 4.1.1</p></li>
24+
</ul>
25+
<h2 id="set-environment-variables">set environment variables</h2>
26+
<p>The OpenCV toolkit requires that you set Linux environment variables to identify the directory where the FFmpeg and OpenCV libraries will be installed. You can set them by copying these lines into your ’$HOME/.bashrc’ script:</p>
27+
<pre><code> export OPENCV_INSTALL_PATH=/usr/local
28+
export LD_LIBRARY_PATH=$OPENCV_INSTALL_PATH/lib:$LD_LIBRARY_PATH </code></pre>
29+
<p>After changing your ’$HOME/.bashrc’ script, you should log off Linux and log back in, to ensure that the new environment variables are set in all shells, including your window manager.</p>
30+
<h2 id="install-packages-from-rhel-or-centos-repositories">install packages from RHEL or CentOS repositories</h2>
31+
<p>The OpenCV toolkit depends upon many tools and libraries that are available as repository packages (RPMs) from RHEL or CentOS repositories. These packages can be installed with administrator tools such as ’yum’. This requires 'root' privileges, which can be acquired temporarily with administrator tools such as ’sudo’.</p>
32+
<p>Most of the packages the toolkit depends upon are stored in the ’base’ repository, which administrator tools such as ’yum’ search by default. The remaining packages are stored in the ’epel (extra packages)’ repository, which is not searched by default.</p>
33+
<p>The ’yum’ tool will include the ’epel’ repository when it searches for repository packages if you first install the ’epel’ package. This requires 'root' privileges. You can do this by entering these commands at a Linux command prompt:</p>
34+
<pre><code> wget http://download.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm
35+
sudo rpm -ivh epel-release-7-5.noarch.rpm</code></pre>
36+
<p>You can install packages the OpenCV toolkit depends upon by entering this command at a Linux command prompt:</p>
37+
<pre><code> sudo yum install gcc-c++ bzip2-devel cmake libcurl-devel gtk2-devel jasper-devel libjpeg-devel libmicrohttpd-devel libpng-devel libsvm-devel libtiff-devel libv41-devel pkgconfig SDL-devel wget yasm zlib-devel pandoc</code></pre>
38+
<h2 id="install-gpu-device-drivers">install GPU device drivers</h2>
39+
<p>If your machine has a GPU, and you want OpenCV to use it, download device drivers for it from the manufacturer’s website and install them before proceeding. Then, when configuring OpenCV with ’cmake’ below, specify <code>-D WITH\_OPENCL=ON</code> instead of <code>-D WITH\_OPENCL=OFF</code>.</p>
40+
<h2 id="build-and-install-the-ffmpeg-library">build and install the FFmpeg library</h2>
41+
<p>The <a href="http://ffmpeg.org/">FFmpeg library</a> contains codecs (encoders and decoders) for many video formats, and can use other codecs that you may have installed separately.</p>
42+
<p>The FFmpeg library is licensed under the GNU Lesser General Public License (LGPL) version 2.1 or later. However, FFmpeg incorporates several optional parts and optimizations that are covered by the GNU General Public License (GPL) version 2.</p>
43+
<p><strong>Please note:</strong> Some codecs included in FFmpeg may be the subject of patents for which licenses may be needed. Please be certain you have authorization to use any such codecs in your application. See <a href="http://ffmpeg.org/legal.html"><a href="http://ffmpeg.org/legal.html">http://ffmpeg.org/legal.html</a></a> and the relevant audio/video websites for more information, or consult with your legal counsel. You may choose to include or exclude support for particular codecs when you configure the library, as described below.</p>
44+
<p>The FFmpeg library must be built and installed from source code. You can download a package containing the source for the current release of the FFmpeg library from here:</p>
45+
<ul>
46+
<li><a href="http://ffmpeg.org/download.html"><a href="http://ffmpeg.org/download.html">http://ffmpeg.org/download.html</a></a></li>
47+
</ul>
48+
<p>After downloading the FFmpeg package you must unpack it, build the libraries, and install them. This requires 'root' privileges.</p>
49+
<p>The FFmpeg library has many configuration options. In particular, support for various video codecs can be included or excluded by specifying additional options of the ’./configure’ command. You can display its options by entering these commands at a Linux prompt:</p>
50+
<pre><code> tar -xvf ffmpeg-3.0.1.tar.bz2
51+
cd ffmpeg-3.0.1
52+
./configure --help</code></pre>
53+
<p>After choosing configuration options for the FFmpeg library, you can build and install it by entering these commands at a Linux prompt:</p>
54+
<pre><code> cd ffmpeg-3.0.1
55+
./configure --prefix=$OPENCV_INSTALL_PATH --enable-shared --enable-swscale --enable-fontconfig --enable-libfreetype ... more options ...
56+
make
57+
sudo make install</code></pre>
58+
<p><strong>Please note:</strong> You should not configure FFmpeg with the '–enable-nonfree' or '--enable-gpl' options unless you have obtained licenses for the video codecs your applications will use.</p>
59+
<p>After you have installed the FFmpeg library, you can verify that it was installed properly by typing the command ’ffmpeg’ without any arguments at a Linux prompt:</p>
60+
<pre><code> ffmpeg</code></pre>
61+
<p>The ’ffmpeg’ command should display its version, configuration and libraries, something like this:</p>
62+
<pre><code> ffmpeg version 3.0.1 Copyright (c) 2000-2016 the FFmpeg developers
63+
built with gcc 4.8.3 (GCC) 20140911 (Red Hat 4.8.3-9)
64+
configuration: --prefix=/usr/local --enable-shared --enable-swscale --enable-fontconfig --enable-libfreetype
65+
libavutil 55. 17.103 / 55. 17.103
66+
libavcodec 57. 24.102 / 57. 24.102
67+
libavformat 57. 25.100 / 57. 25.100
68+
libavdevice 57. 0.101 / 57. 0.101
69+
libavfilter 6. 31.100 / 6. 31.100
70+
libswscale 4. 0.100 / 4. 0.100
71+
libswresample 2. 0.101 / 2. 0.101
72+
libpostproc 54. 0.100 / 54. 0.100
73+
Hyper fast Audio and Video encoder
74+
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...
75+
Use -h to get full help or, even better, run &#39;man ffmpeg&#39;</code></pre>
76+
<p>You can display a full list of the ’ffmpeg’ command’s arguments by entering this at a Linux prompt:</p>
77+
<pre><code> ffmpeg -help full</code></pre>
78+
<p>You can display the video formats and codecs ’ffmpeg’ has been configured to use by entering these commands at a Linux prompt:</p>
79+
<pre><code> ffmpeg -formats
80+
81+
ffmpeg -codecs</code></pre>
82+
<p>For further information, please refer to the ’ffmpeg’ man pages and the <a href="http://ffmpeg.org/documentation.html">online FFmpeg documentation</a>.</p>
83+
<h2 id="build-and-install-the-opencv-library">build and install the OpenCV library</h2>
84+
<p>The <a href="http://opencv.org/">OpenCV library</a> contains many algorithms for processing images in computer vision applications.</p>
85+
<p>The OpenCV library must be built and installed from source code. You can download a package containing the source for the current release of the OpenCV library from here:</p>
86+
<ul>
87+
<li><a href="http://opencv.org/downloads.html"><a href="http://opencv.org/downloads.html">http://opencv.org/downloads.html</a></a></li>
88+
</ul>
89+
<p>After downloading the OpenCV package, you can build and install it by entering these commands at a Linux prompt:</p>
90+
<pre><code> unzip opencv-3.1.0.zip
91+
mkdir opencv-3.1.0-build
92+
cd opencv-3.1.0-build
93+
export PKG_CONFIG_PATH=$OPENCV_INSTALL_PATH/lib/pkgconfig
94+
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=$OPENCV_INSTALL_PATH -D OPENCV_EXTRA_C_FLAGS=&quot;-DHAVE_CAMV4L -DHAVE_CAMV4L2&quot; -D WITH_OPENCL=OFF ../opencv-3.1.0
95+
make
96+
sudo make install</code></pre>
97+
<p><strong>Note:</strong> If your machine has a GPU and you have installed its device drivers, configure ’cmake’ with '-D WITH_OPENCL=ON' instead of '-D WITH_OPENCL=OFF'.</p>
98+
<p>You should confirm that the OpenCV library is configured to use the other libraries you installed above. For example, the ’cmake’ command should display something like this:</p>
99+
<pre><code> -- GUI:
100+
-- QT: NO
101+
-- GTK+ 2.x: YES (ver 2.24.28)
102+
-- GThread : YES (ver 2.42.2)
103+
-- GtkGlExt: NO
104+
-- OpenGL support: NO
105+
-- VTK support: NO
106+
--
107+
-- Media I/O:
108+
-- ZLib: /lib64/libz.so (ver 1.2.7)
109+
-- JPEG: /lib64/libjpeg.so (ver )
110+
-- WEBP: build (ver 0.3.1)
111+
-- PNG: /lib64/libpng.so (ver 1.5.13)
112+
-- TIFF: /lib64/libtiff.so (ver 42 - 4.0.3)
113+
-- JPEG 2000: /lib64/libjasper.so (ver 1.900.1)
114+
-- OpenEXR: build (ver 1.7.1)
115+
-- GDAL: NO
116+
--
117+
-- Video I/O:
118+
-- DC1394 1.x: NO
119+
-- DC1394 2.x: NO
120+
-- FFMPEG: YES
121+
-- codec: YES (ver 57.24.102)
122+
-- format: YES (ver 57.25.100)
123+
-- util: YES (ver 55.17.103)
124+
-- swscale: YES (ver 4.0.100)
125+
-- resample: NO
126+
-- gentoo-style: YES</code></pre>
127+
<p>For further information, please refer to the PDF files installed in /usr/local/share/OpenCV/doc and the <a href="http://opencv.org/documentation.html">online OpenCV documentation</a>.</p>
128+
<h2 id="build-the-opencv-toolkit-for-streams">build the OpenCV toolkit for Streams</h2>
129+
<p>The OpenCV toolkit contains operators for IBM Streams and sample Streams applications that illustrate the use of those operators. The toolkit also contains a contains a library that the operators use to invoke OpenCV algorithms and FFmpeg codecs. You must build the toolkit’s library, and you should build the sample applications so that you can verify that the operators work properly with the other libraries you have installed.</p>
130+
<p>You can download a package containing the OpenCV toolkit from:</p>
131+
<ul>
132+
<li><a href="http://ibmstreams.github.io/streamsx.opencv/">http://ibmstreams.github.io/streamsx.opencv/</a></li>
133+
</ul>
134+
<p>After downloading the OpenCV toolkit package you must unpack it and build its library and sample applications. You can do this by entering these commands at a Linux prompt:</p>
135+
<pre><code> unzip IBMStreams-streamsx.opencv-xxxxxxx.zip
136+
mv streamsx.IBMStreams-streamsx.opencv-xxxxxxx streamsx.opencv
137+
cd streamsx.opencv
138+
make</code></pre>
139+
<p>After building the toolkit’s sample applications, you should execute some of them to verify that the operators work properly on your machine. For instructions on doing this, see <a href="UsingToolkit.html">Using the OpenCV Toolkit</a>.</p>
140+
<p>The OpenCV toolkit documentation is available in 'markdown' and HTML formats in these directories:</p>
141+
<ul>
142+
<li><p>streamsx.opencv/com.ibm.streamsx.opencv/doc/md/index.md</p></li>
143+
<li><p><a href="index.html">streamsx.opencv/com.ibm.streamsx.opencv/doc/html/index.html</a></p></li>
144+
</ul>
145+
<hr />
146+
<p>© Copyright 2012, 2016, International Business Machines Corporation, All Rights Reserved</p>
147+
</body>
148+
</html>

doc/html/Makefile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Copyright (C) 2012, 2016, International Business Machines Corporation
2+
# All Rights Reserved
3+
4+
MD_DIR = ../md
5+
6+
HTML_FILES = index.html InstallingToolkit.html UsingToolkit.html OperatorsAndTypes.html SampleApplications.html
7+
8+
all: $(HTML_FILES)
9+
10+
%.html: $(MD_DIR)/%.md
11+
pandoc --from=markdown_github --to=html5 --output=$@ --standalone $<
12+
13+
clean:
14+
rm -vf *.html

0 commit comments

Comments
 (0)