File: /home/michel/Desktop/harris.cxx

Page 1 of 1

//Signature: HarrisDetectorFilter(MyStandardImage& Img, MyHarrisRespon...
Upcoming SlideShare
Loading in …5
×

Harris Detector Algorithm

662 views

Published on

Corner detection is an approach used within computer vision systems to extract certain kinds of features and infer the contents of an image. Corner detection is frequently used in motion detection, image registration, video tracking, image mosaicing, panorama stitching, 3D modelling and object recognition. This document describes an algorithm for harris corner detector.

Published in: Education
6 Comments
0 Likes
Statistics
Notes
  • Be the first to like this

No Downloads
Views
Total views
662
On SlideShare
0
From Embeds
0
Number of Embeds
5
Actions
Shares
0
Downloads
6
Comments
6
Likes
0
Embeds 0
No embeds

No notes for slide

Harris Detector Algorithm

  1. 1. File: /home/michel/Desktop/harris.cxx Page 1 of 1 //Signature: HarrisDetectorFilter(MyStandardImage& Img, MyHarrisResponseMetric* metric, unsigned int ws) // Computing luminance image MyStandardImage ImgGrayA = RGBtoYUVLuminance(Img); // Computing sobel gradients for the images MyStandardImage ImgGraySobelX = SobelX(ImgGrayA); MyStandardImage ImgGraySobelY = SobelY(ImgGrayA); // Computing derivatives MyStandardImage ImgAx2 = MyStandardImage ImgAy2 = MyStandardImage ImgAxy = products for images ImgGraySobelX*ImgGraySobelX; // Ix2 ImgGraySobelY*ImgGraySobelY; // Iy2 ImgGraySobelX*ImgGraySobelY; // Ixy // Computing blurred images ImgAx2 = GaussianBlur(ImgAx2, ws); ImgAy2 = GaussianBlur(ImgAy2, ws); ImgAxy = GaussianBlur(ImgAxy, ws); // Computing response R for each image pixel. unsigned int _rows = Img.rows(); unsigned int _cols = Img.cols(); MyStandardImage TmpImg = MyStandardImage(_rows, _cols); for (unsigned int i = 0; i < _rows; i++) { for(unsigned int j = 0; j < _cols; j++) { // Computing the trace and determinante of the matrix double determinant = ImgAx2(i,j).r()*ImgAy2(i,j).r() - ImgAxy(i, j).r()*ImgAxy(i, j).r(); double trace = ImgAx2(i,j).r() + ImgAy2(i,j).r(); // Calculating the response Harris R double R = metric->operator()(determinant, trace); TmpImg(i, j) = MyStandardPixel(R, R, R); } } // Returning resultant not normalized image return TmpImg;

×