Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Example Analysis of OpenCV Image feature and harris Corner Detection in Python

2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article mainly introduces the Python OpenCV image features and harris corner detection example analysis, the article is very detailed, has a certain reference value, interested friends must read it!

Concept

Step 1: calculate a gradient Ix,Iy

Step 2: integrate the matrix and calculate the eigenvalues

Step 3: compare the size of eigenvalues

Step 4: non-maximum suppression, leaving the real corner, and filtering out the code around the corner

Import cv2import numpy as npimg = cv2.imread ('pie.png') print (' img.shape',img.shape) gray = cv2.cvtColor (img,cv2.COLOR_BGR2GRAY) # gray = np.float32 (gray) dst = cv2.cornerHarris (gray,2,3,0.04) print ('dst.shape',dst.shape)

Img [dst > 0.01*dst.max ()] = [0mem0255] cv2.imshow ('dst',img) cv2.waitKey (0) cv2.destroyAllWindows ()

The above is all the contents of the article "sample Analysis of OpenCV Image Features and harris Corner Detection in Python". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report