1.3K views

Uploaded by pi194043

using integral image for fast computation of mean and variance of a image rectangular patch

save

You are on page 1of 5

Pi19404

January 17, 2014

Contents

Contents

Integral Images for computing Mean and Variance

0.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2|5

0.1 Introduction

The Integral Image is used as a quick and effective way of calculating the sum of values (pixel values) in a given image AS or a rectangular subset of a grid (the given image). In this article we will assume that concepts of integral image is known and then proceed to see how it can be used to compute the mean and variance of a image patch. Given a integral representation of an image,the sum of value of pixels in the rectangular region R with vertices A,B,C,D is given by

S (A) + S (D) S (B ) S (C )

Dividing this quantity by the number of pixels gives us the mean value of pixels in the region.

=

I N

Let us also consider the squared integral image.To obtain this all the pixel values in the image are squared then integral image is computed. consider the variance about a rectangulation regions

v=

X x v Xx Xx

(

i

2

i

+

v=

Xx

2

i i

The summation x2 can obtained by the square integral image and i can be obtained by integral image computation.

This enables us to compute the variance of rectangular patch of image. A similar method can be employed to compute the denominator variance term normalize cross correlation formula.

3|5

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44

nclude "integralImage.h" ass IntegralImage blic: t _integral; t _sq_integral; t _image; tegralImage(); //integral image //sq integral image //original image

function too compute integral image id compute(Mat image); function to compute mean value of a patch oat calcMean(Rect r); function to compute variance of a patch oat calcVariance(Rect r); tegralImage::IntegralImage()

id IntegralImage::compute(Mat image) age.copyTo(_image); ::integral(_image,_integral,_sq_integral); oat IntegralImage::calcMean(Rect r) int width=_integral.cols; int height=_integral.rows; unsigned int *ii1 =(unsigned int *)_integral.data; int a=r.x+(r.y*width); int b=(r.x+r.width)+(r.y*width); int c=r.x+((r.y+r.height)*width); int d=(r.x+r.width)+(r.y+r.height)*width; float mx=ii1[a]+ii1[d]-ii1[b]-ii1[c]; mx=mx/(r.width*r.height); return mx;

oat IntegralImage::calcVariance(Rect r)

4|5

45 46 47 48 49 50 51 52 53 54 55 56 57 58

int width=_integral.cols; int height=_integral.rows; int a=r.x+(r.y*width); int b=(r.x+r.width)+(r.y*width); int c=r.x+((r.y+r.height)*width); int d=(r.x+r.width)+(r.y+r.height)*width; float mx=calcMean(r); double *ii2 = (double *)_sq_integral.data; float mx2=ii2[a]+ii2[d]-ii2[b]-ii2[c]; mx2=mx2/(r.width*r.height); mx2=mx2-(mx*mx); return mx2;

the above code can be found in git repo https://github.com/ pi19404/OpenVision/tree/master/ ImgFeatures/integralImage.cpp and ImgFeatures/integralImage.hpp files.

5|5

- Babbie Basics 5e PPT Ch 14Uploaded byRandy Cavalera
- 09 Impq Maths Sa 2 7 StatisticsUploaded byGudipati Rajesh
- Mean Shift AlgorithmUploaded bypi194043
- EXP-09Uploaded byMohammad Ihsan
- Basic Level - Assignment 1Uploaded byAkash Dubey
- Uniform Local Binary Pattern and Spatial Histogram ComputationUploaded bypi194043
- Presentation & Analysis of Data_By_AbuBakkar MarwatUploaded byAbu Bakkar
- ASWchapter6Uploaded byKamal Yagami
- MGT 305 MOD 3 CYUUploaded bymawande
- Standard deviationUploaded byfaisal
- Standard DeviationUploaded byPresana Vision
- Tutorial 7 Yr6 HL 2018-08-31 OptionsUploaded byEjaz Ahmad
- SamplingUploaded byjuchama4256
- chapter 4.pptxUploaded byshafin143
- Lec 3 SamplingUploaded bysalman7797
- mergency ColletsUploaded byJoe Andrews
- drag coefficient taguchiUploaded byapi-309373770
- Penyakit5Uploaded byYhuyunlheaElf-Sanzha
- FormulaUploaded bykumar030290
- Edexcel S1 NotesUploaded byTamannaBhatia
- Chapter05 VamUploaded byVamshi Krishna
- Assignment 3Uploaded byAneeqAmrit
- sampleUploaded byMatt GTE
- 225 final 2010 (2)Uploaded byNoe Lopez
- LRFDStrucEngUploaded byGilberto Guerra-Flores
- Well Known InequalitiesUploaded byantiarchit
- field placement evaluationUploaded byapi-256547746
- S1 January 2012 Question PaperUploaded bygerikaalhu
- Session 9 21Uploaded bynikaro1989
- Credit Calc (3)Uploaded byPrerak Panwar

- Gaussian Multivariate Distribution -Part 1Uploaded bypi194043
- Compiling Native C/C++ library for AndroidUploaded bypi194043
- Multi Class Logistic Regression Training and TestingUploaded bypi194043
- Polynomial Approximation of 2D image patch -Part 2Uploaded bypi194043
- Modified Canny Edge DetectionUploaded bypi194043
- polynomial approximation of a 2D signalUploaded bypi194043
- Markov chain implementation in C++ using EigenUploaded bypi194043
- Implementation of discrete hidden markov model for sequence classification in C++ using EigenUploaded bypi194043
- Dense optical flow expansion based on polynomial basis approximationUploaded bypi194043
- Fast 2D Separable Symmetric/Anti-Symmmetric ConvolutionUploaded bypi194043
- Continuous Emission Hidden Markov Model for sequence classificationUploaded bypi194043
- OpenVision Library Gaussian Mixture Model ImplementationUploaded bypi194043
- ARM Neon Optimization for image interleaving and deinterleavingUploaded bypi194043
- A linear channel filterUploaded bypi194043
- Adaptive Skin Color DetectorUploaded bypi194043
- Embedded Systems Programming with ARM on Linux - Blinking LEDUploaded bypi194043
- C++ Class Members and friendsUploaded bypi194043
- Random Ferns for Patch DescriptionUploaded bypi194043
- Polynomial Approximation of 1D signalUploaded bypi194043
- C++ Const,Volatile Type QualifiersUploaded bypi194043
- Local Binary PatternUploaded bypi194043
- C++ InheritanceUploaded bypi194043
- Normalized convolution for image interpolationUploaded bypi194043
- Tan and Triggs Illumination normalizationUploaded bypi194043
- Uniform Local Binary Pattern and Spatial Histogram ComputationUploaded bypi194043
- Mean Shift TrackingUploaded bypi194043
- C++ static members and functionUploaded bypi194043
- C++ virtual functions and abstract classUploaded bypi194043

- CIRCULAR-177-DE-2007Uploaded byDIEGO
- Agile Portfolio Management Rally Keynote PptxUploaded byaaaa
- 14-312-bm-07_exec_and_fork_Uploaded byTalha Laique
- Citrix Provisioning Services 5.6 SP1 Administrator's GuideUploaded byStefano Maranzana
- Boletin_FISICA_2017.pdfUploaded byfoca88
- CraneUploaded byAdrian Franco Molina
- Esquema Paginas Web FinalUploaded byMartin Quintana
- Multimedia Animacio Pac2Uploaded byMaria Jose Vidal Morant
- XE7 DevGuide.chapter 1-4.pdfUploaded byamazingchickn
- GuiaUploaded bybortles1
- Xataka Windows - Cómo Optimizar El Funcionamiento de Nuestro SSD en Windows 8Uploaded byJose Enrique Palmar
- MathcadWorkSheetAsFlowChartEngUploaded byscribduser9999
- SQL.docxUploaded byPriyankaReddy
- Lab01 ExcelUploaded byLeoramcs
- White Paper Openmatics, ZF Friedrichshafen AG - A platform for all telematics applications_EnglishUploaded bywe.CONECT Global Leaders GmbH
- Features OXEUploaded byTestoun Kacim
- prob22Uploaded byJorge Gustavo Hilgenberg
- [IELTS TUTOR]_IELTS Writing Task 2_Topic Technology_ Bài sửa siêu kĩUploaded byTUTOR IELTS
- SysMLandRhapsodyWhitePaperFINALUploaded bykbasibuyuk
- caatUploaded bysajib_dk
- Guia MatlabUploaded byRichart Aviles Valencia
- CV- Abbas EssaUploaded byAnas Issa
- MCSL-036-Dec-2012Uploaded byNilofer Varis
- Métodos Numéricos - Trabajo Grupal de Primera Unidad.docxUploaded byLuis Ruiz Avileno
- Midshire Business Systems - Lexmark XM7100 - Monochrome Laser MFP BrochureUploaded byadietopping
- Mechanical Drafting and Design SyllabusUploaded byAndi Zaidan
- 95477267-examen-2Uploaded byVanessa Cabrera
- A Tutorial on Spectral ClusteringUploaded bymez007
- S7 Timers Display on WINCC FlexUploaded byayman qunaibi
- Herramientas digitales: Uso y potencial educativoUploaded byClaudia Herrera