Opencv Bfmatcher Match() Always Return Error
I'm training a BFMatcher with 4 descriptors: bf = cv2.BFMatcher() bf.clear() bf.add(des1) bf.add(des2) bf.add(des3) bf.add(des4) bf.train() bf.match(des1) The code bf.match(des1
Solution 1:
You are right, you can add descriptors in lists but you can only match with single descriptors, so, go over the whole des1 array and match every single descriptor and save the matches in a list, or a set if you don't want them to be repeated!
matches=set()
fordescin desc1:
matches_img = bf.knnMatch(desc,k=2)
formatchin matches_img:
matches.add(match)
Post a Comment for "Opencv Bfmatcher Match() Always Return Error"