码迷,mamicode.com
首页 > 其他好文 > 详细

harris推导,参见opencv文档

时间:2017-02-13 12:32:48      阅读:293      评论:0      收藏:0      [点我收藏+]

标签:direction   expressed   元素   高斯函数   ica   tom   cal   core   aac   

  • Let’s look for corners. Since corners represents a variation in the gradient in the image, we will look for this “variation”.

  • Consider a grayscale image 技术分享. We are going to sweep a window 技术分享 (with displacements 技术分享 in the x direction and 技术分享 in the right direction) 技术分享 and will calculate the variation of intensity.

  • 技术分享

    where:

    • 技术分享 is the window at position 技术分享
    • 技术分享 is the intensity at 技术分享
    • 技术分享 is the intensity at the moved window 技术分享
  • Since we are looking for windows with corners, we are looking for windows with a large variation in intensity. Hence, we have to maximize the equation above, specifically the term:

    技术分享

  • Using Taylor expansion:

    技术分享

  • Expanding the equation and cancelling properly:

    技术分享

  • Which can be expressed in a matrix form as:

    技术分享

  • Let’s denote:

    技术分享

  • So, our equation now is:

    技术分享

  • A score is calculated for each window, to determine if it can possibly contain a corner:

    技术分享

    where:

    • det(M) = 技术分享
    • trace(M) = 技术分享

    a window with a score 技术分享 greater than a certain value is considered a “corner”

中文说明:

Harris角点算法实现

根据上述讨论,可以将Harris图像角点检测算法归纳如下,共分以下五步:

1. 计算图像I(x,y)I(x,y)在XX和YY两个方向的梯度IxIyIx、Iy。

Ix=?I?x=I?(?1 0 1)Iy=?I?x=I?(?1 0 1)TIx=?I?x=I?(?1 0 1),Iy=?I?x=I?(?1 0 1)T

 

2. 计算图像两个方向梯度的乘积。

I2x=Ix?IyI2y=Iy?IyIxy=Ix?IyIx2=Ix?Iy,Iy2=Iy?Iy,Ixy=Ix?Iy

 

3. 使用高斯函数对I2xI2yIxyIx2、Iy2和Ixy进行高斯加权(取σ=1σ=1),生成矩阵MM的元素ABA、B和CC。

A=g(I2x)=I2x?wC=g(I2y)=I2y?wB=g(Ix,y)=Ixy?wA=g(Ix2)=Ix2?w,C=g(Iy2)=Iy2?w,B=g(Ix,y)=Ixy?w

 

4. 计算每个像素的Harris响应值RR,并对小于某一阈值tt的RR置为零。

R={R:detM?α(traceM)2<t}R={R:detM?α(traceM)2<t}

 

5. 在3×33×3或5×55×5的邻域内进行非最大值抑制,局部最大值点即为图像中的角点。

harris推导,参见opencv文档

标签:direction   expressed   元素   高斯函数   ica   tom   cal   core   aac   

原文地址:http://www.cnblogs.com/duimu/p/6393156.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!