opencv如何用ORB特征提取并过滤?
import sysimport cv2 as cv
import numpy as np
def main_func():
imgCat = cv.imread("cat.jpg")
imgSmallCat = cv.imread("smallCat.jpg")
orb = cv.ORB_create()
kpCat, desCat = orb.detectAndCompute(imgCat,None)
kpSmallCat, desSmallCat = orb.detectAndCompute(imgSmallCat, None)
bf = cv.BFMatcher_create(cv.NORM_HAMMING, crossCheck=True)
matches = bf.match(desCat, desSmallCat)
matchImg = cv.drawMatches(imgCat, kpCat, imgSmallCat, kpSmallCat, matches, None)
cv.imshow("Cat", imgCat)
cv.imshow("SmallCat", imgSmallCat)
cv.imshow('match', matchImg)
cv.waitKey(0)
if __name__ == '__main__':
main_func()
cv2.xfeatures2d.SIFT 要老版本opencv
所以不想用SIFT
直接用ORB
比如我只要 横着的线
不要竖着的线
应该怎么过滤
以上是 opencv如何用ORB特征提取并过滤? 的全部内容, 来源链接: utcz.com/p/938625.html