# Add itkIntegralImageFilter

**URL:** https://discourse.itk.org/t/add-itkintegralimagefilter/744
**Category:** Algorithms
**Created:** [March 7, 2018, 6:48pm UTC](https://discourse.itk.org/t/add-itkintegralimagefilter/744 "2018-03-07T18:48:53Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Besler](https://discourse.itk.org/user_avatar/discourse.itk.org/besler/32/135_2.png) [@Besler](https://discourse.itk.org/u/Besler)
#### Post date: [March 7, 2018, 6:48pm UTC](https://discourse.itk.org/t/add-itkintegralimagefilter/744/1 "2018-03-07T18:48:53Z")

</div>

Hi Everyone!

I am interested in using some Haar-like features for an object recognition task. I think an integral image is the way to go for computational performance. (I need to take the features further after this which is easy if I have an integral image.)

Searching, no integral image algorithm exists. I would be able to implement the N dimensional version (at least single threaded). The issue is that the algorithm doesn’t vectorize well. However, it does appears to have overlapping sub problems. Maybe some dynamic programming tricks?

Before I go ahead and try and do this, any suggestions from the ITK community? Would this be a useful contribution?

Thank you!  
Bryce

Some notes:

> **[Viola–Jones object detection framework](https://en.m.wikipedia.org/wiki/Viola%E2%80%93Jones_object_detection_framework)**
>
> The Viola–Jones object detection framework is the first object detection framework to provide competitive object detection rates in real-time proposed in 2001 by Paul Viola and Michael Jones. Although it can be trained to detect a variety of object classes, it was motivated primarily by the problem of face detection. 
> The problem to be solved is detection of faces in an image. A human can do this easily, but a computer needs precise instructions and constraints. To make the task more manageable...

  

> **[Summed-area table](https://en.m.wikipedia.org/wiki/Summed-area_table)**
>
> A summed-area table is a data structure and algorithm for quickly and efficiently generating the sum of values in a rectangular subset of a grid. In the image processing domain, it is also known as an integral image. It was introduced to computer graphics in 1984 by Frank Crow for use with mipmaps. In computer vision it was popularized by Lewis and then given the name "integral image" and prominently used within the Viola–Jones object detection framework in 2001. Historically, this principle i As...

  

> <https://stackoverflow.com/questions/46520275/how-to-speed-up-calculation-of-integral-image>

---

<div class="post-metadata">

### Author: ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)
#### Post date: [March 7, 2018, 9:50pm UTC](https://discourse.itk.org/t/add-itkintegralimagefilter/744/2 "2018-03-07T21:50:13Z")

</div>

The normal algorithm already utilizes “dynamic programming tricks”.

As parallel implementation is non-trivial, it would be quite useful to have it in ITK.

As single-threaded implementation is almost a single iterator loop (with special handling of edge cases), it is of lower value as a stand-alone filter but would still be welcome.

Using the existing [boundary condition](https://itk.org/Doxygen/html/classitk_1_1ConstantBoundaryCondition.html) with value 0 might be of use for either single-threaded or multi-threaded implementation.
