当前位置:网站首页>Harris corner detection opencv
Harris corner detection opencv
2022-06-11 03:03:00 【Solitary rest】
Corner point
That is, points with obvious characteristics , Intuitive, , It can be regarded as all kinds of images “ horn ”, For example, the top corner of a house , The square corners of a chessboard, etc , For example, the blue dot in the following figure :

Harris Corner detection
Divide the original image into small windows , take :

here ,Ix and Iy Namely x and y The image derivative of the direction .( These can be used cv.Sobel() Easy to find )
And take

among :
det(M) = λ1λ2
trace(M) = λ1 + λ2
λ1 and λ2 yes M The eigenvalues of the
When |R| When I was a child , That is to say λ1 and λ2 When they were young , The area is flat .
When R < 0 when , That is to say λ1 >> λ2 Or vice versa , This area is the edge .
When R When a large , That is to say λ1 and λ2 It's big and λ1∼λ2 when , This area is a corner .
dst = cv.cornerHarris(gray,blockSize,ksize,k) • img - The data type is float32 The input image of . • blockSize - The domain size to be considered in corner detection . • ksize - Sobel Window size used in derivation • k - Harris Free parameters in corner detection equation , The value parameter is [0,04,0.06].
practice :
Original image :

Code :
import cv2.cv2
import numpy as np
import cv2 as cv
from matplotlib import pyplot as plt
img = cv.imread(r'XXXX.jpg')
gray = cv.cvtColor(img,cv.COLOR_BGR2GRAY)
gray = np.float32(gray)
dst = cv.cornerHarris(gray,2,3,0.04)
dst = cv.dilate(dst,None)
img[dst>0.01*dst.max()]=[0,0,255]
cv.imshow('dst',img)
cv.waitKey(0)
result :

边栏推荐
猜你喜欢

Baidu submits sitemap to prompt the solution of "index type is not handled"

B_QuRT_User_Guide(17)
![[big guy show] aiops in the eyes of Borui data, choosing the right track and the right people](/img/a6/61d125326fc81532a56858c384460f.jpg)
[big guy show] aiops in the eyes of Borui data, choosing the right track and the right people

AOSP ~ modify WebView default implementation

. Net module and assembly - NET Module vs Assembly

Go 语言的优势和学习路线图

The solution of invalid @data annotation in idea2018

新来的同事问我 where 1=1 是什么意思???

sonarqube平台基础使用

银行选择电子招标采购的必要性
随机推荐
Problems with JDBC tool classes
最长递增子序列
WordPress upgrade error: briefly unavailable for scheduled maintenance [resolved]
Manon's advanced road - Daily anecdotes
微信模版消息errcode“:40165,“errmsg“:“invalid weapp pagepath
@Controller @transactional @service annotation is invalid and less dependent
HUST Software Engineering (Experiment 2) -- TDD test driven development experiment.
ROS基础 - 使用 launch 文件(一) - 批量启动多个ROS节点
位置数据融合表3
OpenJudge NOI 1.13 17:文字排版
The two departments jointly issued the nine provisions on fire safety management of off campus training institutions
B_QuRT_User_Guide(16)
怎样简洁明了地说清楚产品需求?
C语言指针
配置用命令行编译的环境-MSVC
HUST软件工程(实验2)--TDD测试驱动开发实验。
已解决: JDBC连接Mysql失败报错: 'The last packet sent successfully to the server was 0 milliseconds ago. '
. Net module and assembly - NET Module vs Assembly
Android WiFi hide SSID
How to fix syntax errors in WordPress websites