Skip to Main Content
Learning OpenCV
book

Learning OpenCV

by Gary Bradski, Adrian Kaehler
September 2008
Beginner to intermediate content levelBeginner to intermediate
580 pages
20h 7m
English
O'Reilly Media, Inc.
Content preview from Learning OpenCV

Integral Images

OpenCV allows you to calculate an integral image easily with the appropriately named cvIntegral() function. An integral image [Viola04] is a data structure that allows rapid summing of subregions. Such summations are useful in many applications; a notable one is the computation of Haar wavelets, which are used in some face recognition and similar algorithms.

void cvIntegral(
   const CvArr* image,
   CvArr*       sum,
   CvArr*       sqsum      = NULL,
   CvArr*       tilted_sum = NULL
);

The arguments to cvIntegral() are the original image as well as pointers to destination images for the results. The argument sum is required; the others, sqsum and tilted_sum, may be provided if desired. (Actually, the arguments need not be images; they could be matrices, but in practice, they are usually images.) When the input image is 8-bit unsigned, the sum or tilted_sum may be 32-bit integer or floating-point arrays. For all other cases, the sum or tilted_sum must be floating-point valued (either 32- or 64-bit). The result "images" must always be floating-point. If the input image is of size W-by-H, then the output images must be of size (W + 1)-by-(H + 1). [86]

An integral image sum has the form:

image with no caption

The optional sqsum image is the sum of squares:

image with no caption

and the tilted_sum is like the sum except that it is for the image rotated ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Learning OpenCV 3

Learning OpenCV 3

Adrian Kaehler, Gary Bradski
Learning OpenCV, 2nd Edition

Learning OpenCV, 2nd Edition

Adrian Kaehler, Gary Bradski
Practical OpenCV

Practical OpenCV

Samarth Brahmbhatt
Machine Learning for OpenCV

Machine Learning for OpenCV

Michael Beyeler, Michael Beyeler (USD)

Publisher Resources

ISBN: 9780596516130Supplemental ContentErrata Page