PROGRAMMING WITH INTEL IPP
(INTEGRATED PERFORMANCE PRIMITIVES)
AND INTEL OPENCV
(OPEN COMPUTER VISION)
UNDER GNU LINUX
A BEGINNER’S TUTORIAL
by J
´
ER
ˆ
OME LAN DR
´
E
j.Landre@iutlecreusot.u-bourgogne.fr
version 0.4 - July 2003
Universit´e de Bourgogne
Institut Universitaire de Technologie
Laboratoire
´
Electronique, Informatique et Images
U.M.R. C.N.R.S. 5158
12, rue de la Fonderie
71 200 Le Creusot
FRANCE
t´el. +33 (0)3–85–73–10–00
fax +33 (0)3–85–73–10–99
http://iutlecreusot.u-bourgogne.fr
To Life, Love, Dreams and Peace...
Contents
1 Introduction 5
1.1 Foreword . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.2 About this tutorial . . . . . . . . . . . . . . . . . . . . . . . . 5
1.3 Intel IPP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.4 Intel OpenCV . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.5 Prerequisites . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.6 Presentation of chapters . . . . . . . . . . . . . . . . . . . . 7
2 Installation under GNU Linux 9
2.1 IPP installation . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.2 OpenCV installation . . . . . . . . . . . . . . . . . . . . . . . 12
2.3 Linux and libraries. . . . . . . . . . . . . . . . . . . . . . . . . 17
2.4 Directory structure . . . . . . . . . . . . . . . . . . . . . . . 19
3 Basic OpenCV 21
3.1 General information . . . . . . . . . . . . . . . . . . . . . . . 21
3.2 Creating an image . . . . . . . . . . . . . . . . . . . . . . . . 22
3.3 Loading and displaying files . . . . . . . . . . . . . . . . . . 24
3.4 Makefile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
3.5 JPEG and BMP are different . . . . . . . . . . . . . . . . . . 26
3.6 Color conversion using OpenCV . . . . . . . . . . . . . . . . 28
4 Basic IPP 33
4.1 General information . . . . . . . . . . . . . . . . . . . . . . . 33
4.2 A small example to begin with . . . . . . . . . . . . . . . . . 37
4.3 Color conversion under IPP . . . . . . . . . . . . . . . . . . . 39
4.4 Filtering and saving an image . . . . . . . . . . . . . . . . . 42
5 Conclusion 49
A Internet websites 51
B Libraries overview 53
B.1 Intel Performance Primitives (IPP) . . . . . . . . . . . . . . . 53
B.2 Open Computer Vision Library (OpenCV) . . . . . . . . . . . 54
3
C Copyright information 55
Chapter 1
Introduction
“Every man has two nations and one of them is France.”
Benjamin FRANKLIN — 1706-1790
1.1 Foreword
Writing a book, especially a tutorial is not an easy task. Teaching is
a very interesting job but also a very difficult one because you need to
give interesting information on a subject to people that are not used
with this subject. You need to be clear and precise to make your assis-
tance understand what you want to explain. I want to be as precise as
possible but without any warranty of success. Your judgment will be
the best way for me to see if I was good or not.
Because english (and US english) is not my mother language,
I want to apologize for any mistake encountered in the pages of this
manual. I have tried to do my best to produce a good written english,
however any comment is welcome to improve its quality.
1.2 About this tutorial
This manual is dedicated to the use of Intel signal and image processing
libraries: IPP (Integrated Performance Primitives) and OpenCV (Open
Computer Vision). The aim of this book is not to enter deeply into
details but to introduce the concepts used in these libraries.
IPP is a commercial low-level library for signal processing, image
processing and matrix computation developed by Intel Corporation. It
offers functions that are optimized to run on Intel Processors (Pentium,
Pentium II, Pentium III, Pentium 4 and Itanium) and to take in account
special abilities such as MMX (MultiMedia eXtensions), SSE (Streaming
Single instruction multiple data Extensions), and SSE2 cabled instruc-
tions. So you need to have an Intel processor on our computer in order
5