Get the App
SLTechnology News&Howtos  ›  Development  › 

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

Shulou Source: shulou.com Published: 2022-06-03 13:56:07 10月02日 Update

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!

Tags: Features images examples analysis detection content eigenvalues articles code values interests size fellows buddies more Maxima gradients concepts knowledge matrices Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Redmi Shulou Technology MariaDB Huawei Xiaomi