Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

this is a simple typo.

see:

>>> help(cv2.BFMatcher())
Help on BFMatcher object:

class BFMatcher(DescriptorMatcher)
 ...
 |  knnMatch(...)
 |      knnMatch(queryDescriptors, trainDescriptors, k[, mask[, compactResult]])
 -> matches  or  knnMatch(queryDescriptors, k[, masks[, compactResult]]) -> matches
 |
 |  match(...)
 |      match(queryDescriptors, trainDescriptors[, mask]) -> matches  or  match(
queryDescriptors[, masks]) -> matches
 |
 |  train(...)
 |      train() -> None
 |
 ...

so, it simply should be:

matches=bf.knnMatch(des1,des2,k=2) # case sensitive !

this is a simple typo.

see:

>>> help(cv2.BFMatcher())
Help on BFMatcher object:

class BFMatcher(DescriptorMatcher)
 ...
 |  knnMatch(...)
 |      knnMatch(queryDescriptors, trainDescriptors, k[, mask[, compactResult]])
 -> matches  or  knnMatch(queryDescriptors, k[, masks[, compactResult]]) -> matches
 |
 |  match(...)
 |      match(queryDescriptors, trainDescriptors[, mask]) -> matches  or  match(
queryDescriptors[, masks]) -> matches
 |
 |  train(...)
 |      train() -> None
 |
 ...

so, it simply should be:

matches=bf.knnMatch(des1,des2,k=2) # case sensitive !