2.3K views

Uploaded by pi194043

Overview and code for SubPixel Corner Localization Algorithm.Refer to website for details regarding OpenCV code and other related articles

save

- OpenCL Heterogenenous program for Image Processing - ColorSpace conversion BGR-HSV,HSV-BGR,BGR-GRAY
- Normalized convolution for image interpolation
- Fast 2D Separable Symmetric/Anti-Symmmetric Convolution
- A linear channel filter
- Fast Asymmetric Learning for Cascade Face Detection Training/Testing Utility
- OpenCL Image Convolution Filter - Box Filter
- polynomial approximation of a 2D signal
- Modified Canny Edge Detection
- Feature Detection - Overview of Harris Corner Feature Detection
- Polynomial Approximation of 1D signal
- OpenCL 2D Convolution Using Separable Filters -Box Filter
- Fast 3D Extension of Fast Feature Detection for SpatioTemporal Corner Detection
- Robot Vision
- A detailed descriptions and results for different color constancy algorithms
- 637834main_Remote_Sensing_Math.pdf
- Leica ScanStation C10 DS En
- Control Limited Adaptive Histogram Equalization for Image Enhancement
- Spatio Temporal Feature extraction using harris 3d corner detector
- Dense optical flow expansion based on polynomial basis approximation
- 13_TrajectoryPlanningJoints
- Adaptive Skin Color Detector
- 001_AssignmentDM1
- Philips SH 4 190S5 19inch LCD Monitor Sm
- Android OpenCV Face detection
- Markov chain implementation in C++ using Eigen
- Implementation of discrete hidden markov model for sequence classification in C++ using Eigen
- Continuous Emission Hidden Markov Model for sequence classification
- Dense optical flow expansion based on polynomial basis approximation
- Adaptive Skin Color Detector
- ARM Neon Optimization for image interleaving and deinterleaving
- OpenVision Library Gaussian Mixture Model Implementation
- Multi Class Logistic Regression Training and Testing
- Compiling Native C/C++ library for Android
- Gaussian Multivariate Distribution -Part 1
- Polynomial Approximation of 2D image patch -Part 2
- Modified Canny Edge Detection
- Tan and Triggs Illumination normalization
- Uniform Local Binary Pattern and Spatial Histogram Computation
- C++ static members and function
- C++ virtual functions and abstract class
- Embedded Systems Programming with ARM on Linux - Blinking LED
- Random Ferns for Patch Description
- Integral Image for Computation of Mean And Variance
- polynomial approximation of a 2D signal
- C++ Const,Volatile Type Qualifiers
- Polynomial Approximation of 1D signal
- C++ Inheritance
- Mean Shift Algorithm
- Local Binary Pattern
- Canny edge detector algorithm matlab codes
- Product Piracy Prevention: Product Counterfeit Detection without Security Labels
- c2
- Deber de Convolucion Sistemas
- Toerema de Convolucion
- Sift
- Algorithm for the Comparison of Different Types of First Order Edge Detection Techniques
- Portable Camera-based Assistive Text and Product Label Reading from Hand-held Objects for Blind Persons
- 1703.06376.pdf
- Object Detection Techniques - OpenCV & Robotics
- Image Processing
- Scene Recognition & Classification Using Computer Vision Techniques
- Le Dung Digital Image Processing Chapter III
- Overview of Good Features to Track Feature Detector
- Fast 3D Extension of Fast Feature Detection for SpatioTemporal Corner Detection
- Convolucion
- Computer Vision System Toolbox
- Techniques for Surveillance
- Peter's Functions for Computer Vision
- Codes
- 10.10072F978-3-319-28854-3
- A REAL TIME STATIC HAND GESTURE RECOGNITION FOR HUMAN COMPUTER INTERACTION
- 5 Study and Comparison of Different Edge
- COMPUTER VISION TOOLBOX (MATLAB)
- עיבוד תמונה- הרצאות | Canny Edge Detection
- Edge Detection Project
- Kuliah 10 Deteksi Tepi Canny Edit Print
- IRJET-Object Recognition using Template matching with the help of Features extraction method
- 3caedafdfea1c5b4e77118792b6a22fa4998.pdf
- An Effective Aircraft Recognition System for High Resolution Optical Satellite Sensing Images using Bayesian Pursuit Algorithm

You are on page 1of 13

Pi19404

March 17, 2013

Contents

Contents

Feature Detection - SubPixel Corner Localization Algorithm 3

0.1 Introduction . . . . . . . . . 0.2 Subpixel Corner Algorithms 0.2.1 Implementation . . . 0.3 Results . . . . . . . . . . . . . 0.4 Code . . . . . . . . . . . . . . References . . . . . . . . . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

3 3 8 10 12 12

2 | 13

0.1 Introduction

In the article we will look at refining the corners obtained using feature detection techniques using SubPixel Corner Localization Algorithm.

The basic unit of digital image is pixel which corresponds to integer valued location.However for applications like tracking the integer valued locations may not be accurate enough.Hence a floating point valued representation of corner location is requried .This process of obtaining this is called subpixel corner localization. In a discrete image the pixel intensities are only known at integral locations. In a floating point representation of image ,the pixel intensities are required to be continuous or at subpixel accuracy. The feature/corner detectors help in idenfiying signifciant corner point location upto pixel accuracy or at integral locations.This location is used as initial approximation for subpixel corner location. The subpixel corner localization alogrithms uses the initial approximation as well as local image information to identify the true corner point Let the true corner point be denoted as q(x,y).Let p denote any point in the neighborhood of the true corner point.Let vector q p denote the line joining points p and q and I denote the intensity gradient at point p.

3 | 13

Feature Detection - SubPixel Corner Localization Algorithm that the image gradient at a point close to the center is orthogonal to every vector from the center to that point. For any point p in the neighborhood of true corner point there will exist a the intensity gradient which will be orthogonal to the vector q p .

Two unknowns ie x and y co-ordindates of point p are required to be determined. This is a linear equation in q x and q y the corner which need to be determined.

@A

@A

Thus we require more than one equation to determine the true location of the corner. Let us assume that given the location of corner q we are able to find N such points which satisfy the above equations.This leads to a overconsrained problem.The exact solution may not exists which satisfies all the constraints however a approximate solution can be obtained by least square method. Consider q x y be initial estimate of corner point. Consider a small neighborhood W about the corner point .Let p denote the points in the neighborhood of the corner point.

k T k k i

Compute the dot product at each point of the neighborhood. If point is a true corner point then all residuals will be zero. Thus the aim is to find the point q that best minimizes the sum of squares of residual dot product

4 | 13

@ A@ AaH @ AC @ AaH

I x; y q p

@I @x

xk

xi

@I

@y

yk

yi

C qk

C x

@ A a P @ Ar @ A @ A a P @ A @ A C @ A

g xi ; yi Ii qk pi

k +1

;y

k +1

g xi ; yi

@I

@x

xk

xi

@I

@y

yk

xi

C (x

k+1 ;y k+1 )

@x

aP @ A C

g xi ; yi

A @ A C @ A a H

@I @x

xk

xi

@I

@y

yk

yi

@I

@x

xk

2 g xi ; yi Ix

yk

g xi ; yi Iy

A aP @

Ix xi

@I @y

2 Ix g xi ; yi xi

A C

@I @y

Iy Ix g xi ; yi yi

(1)

C (x

k+1 ;y k+1 )

@x

aP @ A a a

C

g xi ; yi

A @ A C @ A a H

@I @x

xk

yk

yi

xk

g xi ; yi Ix Iy

yk

2 g xi ; yi Iy

A aP @

g xi ; yi Ix Iy xi

CP @

2 Iy g xi ; yi yi

Axk

Dxk

C C

Byk

E yk

5 | 13

Axk

Dxk

C C

Byk

E yk

a a

A D

B E

xk yk

C F

xk yk

a a a

A D

B E

1

C F

xk yk

AE

BD

E D

C F

xk yk

CE AF

BF CD

(2)

AE

BD

xk

a a a a

AE

BD

@ @

CE

BF

A A

yk

AE

BD

AF

CD

B = D

xk

AE

1 2 @C E BF A

B

yk

AE

1 2 @AF

B

CD

A

Ix Iy ; E

aP @ aP @

2 g xi ; yi Ix ; B 2 g xi ; yi Ix xi

A A

aP C

Ix Iy yi ; D

aP @ A aP @ A C

2 g xi ; yi Iy 2 g xi ; yi Iy yi

Ix Iy xi

To simplify the computation at each iteration the window is choose with center as estimated corner location.The computations are performed on a window translated to the origin.Then the results are translated back to the original position. At each step residual error is computed for new estimated values of corner position. The next step of iterations can be computed will newly estimated corner position as input approximation.

6 | 13

Feature Detection - SubPixel Corner Localization Algorithm A Stopping criteria is required to specify when to stop the iterative process. The stopping criteria can be specified in different ways like Maximum number of iterations ,if residual error falls below threshold,change in estimated values of corner position is below a certian threshold. To give importance to functions near the estimated corners compared to far away points a weighted least squares method can be used where the weights are defined using a gaussian function g x ;y is the values of the weighing function at points x ; y which is centered at the approximate corner position.

Let us look at the computation of derivatives.The rectangular ROI is retrived from the image with subpixel accuracy.The rectangular ROI is a rectangular grid with unit distance between adjacent pixels but the starting/end point can consist of floating point values. The values of pixels at non integer co-ordinates is retrieved using bi-linear interpolation.The 4 neighboring integral pixel location which bound the non integral pixel location are determined. The pixel values at non integral location is computed as weighted combination of neighboring known pixel intensity values. The value at the black spot is the sum of the value at each coloured spot multiplied by the area of the rectangle of the same colour, divided by the total area of all four rectangles Let

xf ; yf

(a) Image

cation the integral approximation of center location x2 ; y1 . The values x lies between x1 ; x2 and the point y lies between y1 ; y2 .

f f

7 | 13

0.2.1 Implementation

The input to the algorithm are as follows : 1. input image 2. approximate corner position 3. neighborhood size 4. stopping criteria 5. weighing function For each corner point win_size ; win_size image.

win

xk ; yk

_size

CP

@ C PA

xk ; yk

extract the rectangular area of size about the corner is extracted from the

1 2 3 4 5 6 7 8 9

vector < Point2f > corners ; // vector of corner locatations Mat image ; // original image int _winSize ; // neighborhood size int x1 = max ( corners [ k ]. x - _winSize -1 ,0) ; int y1 = max ( corners [ k ]. y - _winSize -1 ,0) ; int width = _winSize +2; int height = _winSize +2; // neighborhood size Rect roi = Rect ( x1 , y1 , width , height ) ; // extracing image ROI about the corner point Mat local = image ( roi ) ;

For all the points in the window sobel derivatives in x and y directions are compute which are approximation for the first order derivatives of intensity image along the x and y directions required for computations of corner point location.

1 2 3

Mat Dx , Dy ; cv :: Sobel ( local , Dx , CV_32FC (1) ,1 ,0 , _apertureSize ,1 ,0) ; cv :: Sobel ( local , Dy , CV_32FC (1) ,0 ,1 , _apertureSize ,1 ,0) ;

Compute the parameters A,B,C,D,E,F over the specified neighborhood which are require to estimate the new location of corner points. As mentioned earlier the center location will be translated to origin ie the location of pixels range from winS ize= pertureS ize= ; winS ize= pertureS ize= to winS ize= pertureS ize= ; winS ize= pertureS ize= . The corresponding range of derivative matrix is winS ize= ; winS ize=

PA

PC

PC

PA

PA

8 | 13

P @H HA.

;

; winS ize=

PA

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22

double A =0 , B =0 , C =0 , D =0 , E =0 , F =0; int lx =0 , ly =0; for ( int i = _apertureSize /2; i < _winSize ; i ++) { float * dx_ptr = Dx . ptr < float >( i ) ; float * dy_ptr = Dy . ptr < float >( i ) ; ly =i - _winSize /2 - _apertureSize /2; // ( -1 ,0 ,1) for ( int j = _apertureSize /2; j < _winSize ; j ++) { lx =j - winSize /2 - _apertureSize /2; // ( -1 ,0 ,1) double dxx = dx_ptr [ j ]* dx_ptr [ j ]; double dyy = dy_ptr [ j ]* dy_ptr [ j ]; double dxy = dx_ptr [ j ]* dy_ptr [ j ]; A = A + dxx ; B = B + dxy ; E = E + dyy ; C = C + dxx * lx + dxy * ly ; F = F + dxy * Ix + dyy * ly ; } }

Solving the two equations we obtain new estimate for the center corner location. the residual error is computed with estimated corner location which is required for the stopping criteria.

1 2 3 4 5 6 7

// computing denominator double det =( A *E - B * B ) ; det =1./ det ; // translating back to original corner and adding new estimates estimate_corner . x = estimate_corner . x +( C *E - B * F ) * det ; estimate_corner . y = estimate_corner . y +( A *F - C * D ) * det ; double err = pointDist ( estimate_corner , curr_corner ) ;

Stopping criteria used is number of iterations be less than maximim specificed iterations and the change/distance in the estimated corner co-ordinates wrt to previous corner coordinate. is less than a specified values.

9 | 13

Feature Detection - SubPixel Corner Localization Algorithm This method of estimating pixels wit subpixel accuracy gives good results if estimated corner lies in the neighborhood of the approximate corner location.The approximate corner locations must be a good estimate of the desired corner for the method to provide good results.In the present algorithm the criteria used is that estimated corner should lie within a neighborhood of the approximate corner for it to be considered a good estimate else the approximate corner value is retained.

1 2 3 4

if ( fabs ( corners [ k ]. x - estimate_corner . x ) > _winSize || fabs ( corners [ k ]. y - estimate_corner . y ) ) { estimate_corner = corners [ k ]; }

The bilinear intepolation to extract the rectangle with subpixel accuracy is performed using OpenCV function.

1 2

Mat local ; cv :: getRectSubPix ( image , Size ( _winSize +2*( _apertureSize /2) , _winSize +2*( _apertureSize /2) ) , curr_corner , local ) ;

The Default window size is 15,aperture used for computing derivatives is 3, The maximum number of iterations is 10,the maximum change in distance is 0.01.

0.3 Results

10 | 13

Feature Detection - SubPixel Corner Localization Algorithm Subtle difference introduced by subpixel algorithm can be observed in the following images Better corner locations are obtained after application of subpixel algorithm. The Light blue points are locations obtained after application of subpixel algorithm and yellow points are locations obtained by feature detection algorithm. In the Sample image it can be seen that better corner locations are obtained after subpixel localization. The real adavantage cannot be observed visual in 8 bit image but can be noted that subpixel accuracy algorithm provide locations of pixels with higher accuracy. This will be used to improve the robustness of vision based tracking applications which will be used in later articles.

11 | 13

0.4 Code

The class SubPixelCorner defines a class for SubPixelCorner Alcogrithm The input to algorithm is input image and vector of corner locations. The corner locations is a input/output vector which modifies the updated corner location. Code is available in repository https://github.com/pi19404/m19404/ tree/master/FeatureDetector subdirectory.The File names for code containing SubPixelCorner Algorithms are SubPixelCorner.cpp and SubPixelCorner.hpp.

12 | 13

Bibliography

Bibliography

[1] Mauricio Delbracio, Pablo Mus, and Andrs Almansa. Non-parametric Subpixel Local Point Spread Function Estimation. In: Image Processing On Line 2012 (2012). [2]

doi: 10.5201/ipol.2012.admm-nppsf.

Chris Harris and Mike Stephens. A combined corner and edge detector. In: In

Proc. of Fourth Alvey Vision Conference.

[3]

S. Koelstra and I. Patras. The FAST-3D Spatio-Temporal Interest Region Detector. In: Workshop on Image Analysis for Multimedia Interactive Services. 2009, pp. 242245.

[4]

Ivan Laptev. On Space-Time Interest Points. In: Int. J. Comput. Vision 64.2-3

[5]

url: http://dx.doi.org/10.1007/s11263-005-1838-7. pi19404. Overview and Implementation Harris Corner Detection. url: http:

1838-7. / / pi - virtualworld . blogspot . com / 2013 / 02 / feature - detection overview-of-harris.html.

pi19404. Overview and Implementation Harris Corner Detection.

issn:

0920-5691.

[6]

Detector.

[7]

augmented reality. In: Advances in Visual Computing (2005), pp. 294302.

[8]

[9]

Edward Rosten and Tom Drummond. Fusing Points and Lines for High Performance Tracking. In: IN INTERNATIONAL CONFERENCE ON COMPUTER

VISION.

[10]

Edward Rosten and Tom Drummond. Machine learning for high-speed corner detection. In: In European Conference on Computer Vision. 2006, pp. 430443.

[11]

Jianbo Shi and C. Tomasi. Good features to track. In: Computer Vision and

Pattern Recognition, 1994. Proceedings CVPR '94., 1994 IEEE Computer Society Conference on.

doi: 10.1109/CVPR.1994.323794.

13 | 13

- OpenCL Heterogenenous program for Image Processing - ColorSpace conversion BGR-HSV,HSV-BGR,BGR-GRAYUploaded bypi194043
- Normalized convolution for image interpolationUploaded bypi194043
- Fast 2D Separable Symmetric/Anti-Symmmetric ConvolutionUploaded bypi194043
- A linear channel filterUploaded bypi194043
- Fast Asymmetric Learning for Cascade Face Detection Training/Testing UtilityUploaded bypi194043
- OpenCL Image Convolution Filter - Box FilterUploaded bypi194043
- polynomial approximation of a 2D signalUploaded bypi194043
- Modified Canny Edge DetectionUploaded bypi194043
- Feature Detection - Overview of Harris Corner Feature DetectionUploaded bypi194043
- Polynomial Approximation of 1D signalUploaded bypi194043
- OpenCL 2D Convolution Using Separable Filters -Box FilterUploaded bypi194043
- Fast 3D Extension of Fast Feature Detection for SpatioTemporal Corner DetectionUploaded bypi194043
- Robot VisionUploaded byPrasanth Menon
- A detailed descriptions and results for different color constancy algorithmsUploaded bypi194043
- 637834main_Remote_Sensing_Math.pdfUploaded byMichelAndriamahazonoroRaherimanantsoa
- Leica ScanStation C10 DS EnUploaded byBogdan Cîrlugea
- Control Limited Adaptive Histogram Equalization for Image EnhancementUploaded bypi194043
- Spatio Temporal Feature extraction using harris 3d corner detectorUploaded bypi194043
- Dense optical flow expansion based on polynomial basis approximationUploaded bypi194043
- 13_TrajectoryPlanningJointsUploaded byVienNgocQuang
- Adaptive Skin Color DetectorUploaded bypi194043
- 001_AssignmentDM1Uploaded byecorob
- Philips SH 4 190S5 19inch LCD Monitor SmUploaded byRoger Martínez Bermúdez
- Android OpenCV Face detectionUploaded bypi194043

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

- Canny edge detector algorithm matlab codesUploaded bykc_renji85
- Product Piracy Prevention: Product Counterfeit Detection without Security LabelsUploaded byIJCSDF
- c2Uploaded byJoel Eljo Enciso Saravia
- Deber de Convolucion SistemasUploaded byAlexanderTasinchano
- Toerema de ConvolucionUploaded byOmar Jacobo García
- SiftUploaded bytrantinh1010
- Algorithm for the Comparison of Different Types of First Order Edge Detection TechniquesUploaded byInternational Organization of Scientific Research (IOSR)
- Portable Camera-based Assistive Text and Product Label Reading from Hand-held Objects for Blind PersonsUploaded bySripadraj
- 1703.06376.pdfUploaded byRoger Dante Ripas Mamani
- Object Detection Techniques - OpenCV & RoboticsUploaded byMark Labinski
- Image ProcessingUploaded byChristina Floyd
- Scene Recognition & Classification Using Computer Vision TechniquesUploaded byIJRASETPublications
- Le Dung Digital Image Processing Chapter IIIUploaded byHải Trần
- Overview of Good Features to Track Feature DetectorUploaded bypi194043
- Fast 3D Extension of Fast Feature Detection for SpatioTemporal Corner DetectionUploaded bypi194043
- ConvolucionUploaded byAlex Lopez
- Computer Vision System ToolboxUploaded byClaudia Angélica Rivera Romero
- Techniques for SurveillanceUploaded byDurotan123
- Peter's Functions for Computer VisionUploaded byDevidas Jadhav
- CodesUploaded byavbhujle2
- 10.10072F978-3-319-28854-3Uploaded byHARIPRASATH ECE
- A REAL TIME STATIC HAND GESTURE RECOGNITION FOR HUMAN COMPUTER INTERACTIONUploaded byiaetsdiaetsd
- 5 Study and Comparison of Different EdgeUploaded byHemal Vyas
- COMPUTER VISION TOOLBOX (MATLAB)Uploaded byHotland Sitorus
- עיבוד תמונה- הרצאות | Canny Edge DetectionUploaded byRon
- Edge Detection ProjectUploaded byJenish Macwan
- Kuliah 10 Deteksi Tepi Canny Edit PrintUploaded byA Dz Zainuddin
- IRJET-Object Recognition using Template matching with the help of Features extraction methodUploaded byIRJET Journal
- 3caedafdfea1c5b4e77118792b6a22fa4998.pdfUploaded byHọ Và Tên
- An Effective Aircraft Recognition System for High Resolution Optical Satellite Sensing Images using Bayesian Pursuit AlgorithmUploaded byIRJET Journal