Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import cv2
- import numpy as np
- def detect():
- img1 = cv2.imread('znak1.png',1)
- img2 = cv2.imread('znak1.png',1)
- fast = cv2.FastFeatureDetector_create(threshold=70, nonmaxSuppression=1)
- kp1 = fast.detect(img1, None)
- kp2 = fast.detect(img2, None)
- orb = cv2.ORB_create()
- kp1, des1 = orb.compute(img1, kp1)
- kp2, des2 = orb.compute(img2, kp2)
- bf = cv2.BFMatcher(cv2.NORM_HAMMING)
- matches = bf.match(des1, des2)
- img3 = cv2.drawMatches(img1, kp1, img2, kp2, matches[:20], (100, 0, 0))
- cv2.imshow('image', img3)
- cv2.waitKey(0)
- detect()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement