当前位置:网站首页>Harris corner detection principle-
Harris corner detection principle-
2022-06-12 04:44:00 【Avocado yogurt】
This article is my view bilibili The teaching is combined with the observation notes of official documents , Link below :
( whole ) be based on python Of Opencv Project practice _ Bili, Bili _bilibili
If there is anything that is not well understood , Welcome to correct .
theory :
Define the corner first ( Baidu Encyclopedia ): Corner point It's extreme value spot , That is, those with outstanding properties in some aspects spot . Of course , You can define Corner point Properties of ( Set a specific entropy value to Corner point testing ). Corner point It can be the intersection of two lines , It can also be located on two adjacent things with different main directions spot .
opencv Explanation in :corners are regions in the image with large variation in intensity in all the directions.
Show on the image : Pixel values vary greatly in different directions .
So we can take advantage of the different intensity of movement in each direction , Judge whether it is a corner , The formula is as follows :
![\large E(u,v) = \sum_{xy}^{}w(x,y)[f(x+u,y+v)-f(x,y)]^2](http://img.inotgo.com/imagesLocal/202203/01/202203010628325472_1.gif)
The first term is the weight function , The square can be weighted , It can also be Gaussian weighted
The second term is based on Taylor expansion
among : Taylor formula :

Can be approximately equal to :

Two of the partial derivatives can be calculated by gradient function , for example :cv.sobel()
The formula is easily derived as a quadratic form , Can be written as :

among :

Add according to the matrix , Change the accumulator into the matrix .
From the mathematical theorem we can know : A real symmetric matrix must be similarly diagonalized . therefore M The matrix in can be reduced to diagonal matrix :

It's actually an elliptic equation :

Write it as an equation :


therefore :
When λ1 And λ2 When it's big , It means that U,V The direction changes rapidly , Corner expected .
so , A function can be used to describe the relationship between image features , From official documents :

When |R| Small values , signify :λ1 And λ2 Very small , The detection point is flat
When R<0, signify λ1>>λ2 perhaps λ2>>λ1, The detection point is the boundary
When R Great value , signify :λ1 And λ2 It's big , And it's almost the same , The detection point is a corner
function :
cornerHarris(img,blocksize,ksize,k)->dst
•dst - Returns a single channel array
• img - The data type is float32 The input image of .
• blockSize - The specified area in corner detection is small .
• ksize - Sobel Window size used in derivation
• k - The value parameter is [0,04,0.06]
Code :
import cv2 as cv
import numpy as np
img = cv.imread("test_1.jpg"
# You need to pass in a grayscale image
grayimg = cv.cvtColor(img,cv.COLOR_BGR2GRAY)
# The result returned is a single channel array
grayimg = np.float32(grayimg)
dst= cv.cornerHarris(grayimg,2,3,0.04)
img[dst>0.01*dst.max()] = [0,0,255]
cv.imshow("Harris corner",img)
cv.waitKey()
result :
边栏推荐
- LabVIEW关于TDMS和Binary存储速度
- 图解 Apache SkyWalking UI 的使用
- Musk promotes the development of fascinating new products partners remind important questions
- AI and logistics Patent
- Asp. Net core EF value conversion
- QT compile 45 graphic report of security video monitoring system
- Raspberry pie 4B uses Intel movidius NCS 2 for inference acceleration
- Things to challenge
- 1. Mx6ull learning notes (III) - busybox creates root file system
- JWT学习与使用
猜你喜欢
![[automation] generate xlsx report based on openstack automated patrol deployed by kolla](/img/65/f062a6a1080c42857466f13e67fef1.jpg)
[automation] generate xlsx report based on openstack automated patrol deployed by kolla

SQL safe backup display and zoom font support

Gavin teacher's perception of transformer live class - rasa dialogue robot project practice in the field of education agency mode and core component source code analysis under the microservice of educ

疫情数据分析平台工作报告【3】网站部署

Image processing 13- calculation of integral diagram

JWT学习与使用

Mysql主从搭建与Django实现读写分离

SQL injection upload one sentence Trojan horse (turn)

MFC General dialog color dialog

2022 self study materials for Zhejiang computer level III network and security technology examination (1) (updated on 2.28)
随机推荐
Jwt Learning and use
MFC General dialog color dialog
Oracle's instr()
Install/Remove of the Service Denied!
@What happens if bean and @component are used on the same class?
Find missing sequence numbers - SQL query to find missing sequence numbers
Musk promotes the development of fascinating new products partners remind important questions
Day18 creation and restoration of sparse array
Bearpi IOT serial port transceiver 1- normal mode
1. Mx6ull learning notes (II) - uboot migration
Install pycharm under Kali and create a shortcut access
D1 Nezha development board power on record
Things to challenge
1006 next spread
How Windows installs multiple versions of MySQL and starts it at the same time
Zabbix6.0新功能Geomap 地图标记 你会用吗?
EnterpriseTECH STAR Question
疫情数据分析平台工作报告【6】可视化绘图
Thousand word masterpiece "programming biography"
Kill session? This cross domain authentication solution is really elegant!